LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-08-2011, 05:01 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 332

Rep: Reputation: 6
grep reg exp


How would I use a unix grep regular expression to find any two capital letters side by side and how would I find an expected comma in an expected spot? Thanks for any and all replies.
 
Old 01-08-2011, 05:16 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by Garrett85 View Post
How would I use a unix grep regular expression to find any two capital letters side by side and
Code:
egrep "[A-Z]{2}"
grep "[A-Z][A-Z]"

Quote:
Originally Posted by Garrett85 View Post
how would I find an expected comma in an expected spot? Thanks for any and all replies.
By putting a comma in the expected spot.



Cheers,
Tink
 
Old 01-15-2011, 04:13 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Garret, you said in your thread that I moved to GENERAL that you
feel your course left you ill equipped to solve your quizzes.

As far as regular expressions go there are a few very good on-line
tutorials 1) 2), and if you have some money to spare I'd recommend you
get O'Reilly's "Mastering regular expressions" by Jeffrey E.F. Friedl.


Cheers,
Tink


[1] http://www.regular-expressions.info/tutorial.html
[2] http://www.zytrax.com/tech/web/regex.htm
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cp directories for reg exp sebroot Linux - Newbie 1 02-22-2008 09:35 AM
Need help with grep syntax and reg exp Rush_898 Linux - General 2 01-08-2008 10:28 AM
GREP - reg exp to find words ending with .V and .TO vikram_cvk Linux - Server 5 12-22-2006 01:47 PM
prob with reg exp rajatgarg Programming 3 05-28-2004 09:21 AM
Reg Exp ugenn Programming 4 09-19-2002 12:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration