LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-01-2003, 04:38 AM   #1
rytrom
LQ Newbie
 
Registered: Jul 2003
Posts: 27

Rep: Reputation: 15
regexp question


I use bash2.05.

echo "ab]" | grep '^[a-z]*$

How to add ']' in a set of acceptable symbols? \] doesn't work
 
Old 09-01-2003, 10:59 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,746

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
'man regexp' explains how to do it, in the section titled 'Regular Expressions' (last paragraph).
 
Old 09-01-2003, 11:10 AM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
I don't think grep handles regular expressions unless you give the -E or -G option. I could be wrong, but I don't know why they would include those options if grep handled regexps out-of-the-box.
 
Old 09-01-2003, 12:50 PM   #4
rytrom
LQ Newbie
 
Registered: Jul 2003
Posts: 27

Original Poster
Rep: Reputation: 15
Shortly speaking, RTFM, as usual:
[To include a literal ] place it first in the list. Similarly, to include a literal ^ place it anywhere but first. Finally, to include a literal - place it last]
 
  


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
regexp help cliff76 Linux - Newbie 3 03-07-2008 02:15 PM
little help for regexp EmOuBi Linux - Newbie 6 08-06-2005 02:19 AM
Regexp question scuffell Programming 4 04-30-2005 03:35 AM
regexp help ... pld Programming 1 03-15-2005 03:45 PM
postfix regexp question wijnands Linux - Newbie 1 06-03-2004 06:19 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration