Re: [opensuse] regexp -- defference between \< and \b ?



Randall R Schulz wrote:
On Tuesday 29 April 2008 17:58, David C. Rankin wrote:
Listmates:

With regular expressions, what is the difference between \< and \b ?
The man page says:

Which man page? There are many, many programs and libraries that implement regular-expression matching, and REs are by no means singly defined. There are many grammars for notating them and many varieties of fundamental matching constructs.


Actually it comes from man grep. Specifically:

The Backslash Character and Special Expressions
The symbols \< and \> respectively match the empty string at the beginning and end of a word. The symbol \b matches the empty string at the edge of a word, and \B matches the empty string provided it's not at the edge of a word. The symbol \w is a synonym for [[:alnum:]] and \W is a synonym for [^[:alnum:]].


end. Boundaries are either. (Am I going too fast for you??)


Trying to digest BRE (basic RE), ERE (extended RE) and ARE (Advanced RE) in a couple of readings itself moves too fast for me ;-)


Personally, I prefer the old-style \< and \> but apparently they're a thing of the past.


Thanks for your help Randall!

--
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: regular expressions, order of evaluation
    ... inside the first parenthesis, \2 likewise for the 2nd parenthesis. ... most flavours of regular expressions have the ... \1 returns the whole target string, \2 returns the empty string ... Is that statement correct at all, i.e. do indeed most flavours have ...
    (sci.math)
  • Re: Find instance in a string
    ... If there is no 4 character number in the input, an empty string is returned ... The following sites provide a wealth of information on regular expressions. ...
    (microsoft.public.dotnet.languages.vb)
  • [opensuse] regexp -- defference between < and  ?
    ... With regular expressions, what is the difference between \< and \b? ... "The symbols \respectively match the empty string at the beginning and end of a word. ... Nacogdoches, Texas 75961 ...
    (SuSE)
  • Re: Simple Regex issue
    ... > I'm not an expert on regular expressions, but I thought I knew how to ... > expressions match. ... is before or after the | character.) ... matching the empty string before the first | in the first Regex. ...
    (microsoft.public.dotnet.languages.csharp)