LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-16-2011, 09:55 AM   #16
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,834

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976

Yes, but the difference comes when I leave off the \<,\> word boundry anchors. I thought the the whole point was that -w made them unnecessary. Or am I missing something about the way it's supposed to work?

I've read the man page description over and over, and I see nothing there that explains the difference.

I'm using grep GNU grep 2.7 here.
 
Old 11-16-2011, 06:38 PM   #17
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
If you're really interested in the details of regex tools/engines, I highly recommend this book & website http://regex.info/; incredibly informative.
I think the key lesson there is that regex engines vary, so you can't be sure what special chars are or do across different tools and across time...
Other than that, I'd just experiment to see if there is a difference ...
 
Old 11-17-2011, 12:09 AM   #18
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by David the H. View Post
Yes, but the difference comes when I leave off the \<,\> word boundry anchors. I thought the the whole point was that -w made them unnecessary.
My mistake. Testing correctly gives the same results here now.

Changing \< and \> to \b gives the same result as the -iw form.

If \< signifies "\b at the beginning of a word" and \> signifies "\b at the end of a word", that behaviour doesn't make sense to me.

Netsearching did not help. One page says the \b is "for compatibility with GNU Emacs".
 
  


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
PHP5 - Zend Framework->translate: capital vowels with acents disappear j-ray Programming 0 07-25-2011 09:22 AM
grep command john83reuben Linux - Newbie 9 12-09-2009 12:21 PM
How to pass the result of a command to another command (like grep) desb01 Programming 4 06-25-2009 01:09 PM
Help me in Grep Command + cd command in single line JeiPrakash Linux - Newbie 3 05-27-2008 05:16 AM
Marked vowels and Opera 8.5 gbj SUSE / openSUSE 6 09-22-2005 02:10 AM

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

All times are GMT -5. The time now is 01:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration