LinuxQuestions.org
Register a domain and help support LQ
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, 06:01 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 234

Rep: Reputation: 4
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, 06:16 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 05:13 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:35 AM
Need help with grep syntax and reg exp Rush_898 Linux - General 2 01-08-2008 11:28 AM
GREP - reg exp to find words ending with .V and .TO vikram_cvk Linux - Server 5 12-22-2006 02:47 PM
prob with reg exp rajatgarg Programming 3 05-28-2004 10:21 AM
Reg Exp ugenn Programming 4 09-19-2002 01:01 PM


All times are GMT -5. The time now is 03:27 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration