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



On Tuesday 29 April 2008 21:53, David C. Rankin wrote:
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? ...

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, ...

I guess it's been a long time since I've read the man page for the grep
family. I didn't realize \b and \B were a part of Gnu grep.


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.

I know that the Java standard library RE patterns don't have \< and \>,
and apart from egrep and sed, most of the time I enter a regular
expression it's in a Java application (or code) that uses those library
classes, so I have to use \b.


Thanks for your help Randall!

Sure. I learned something, too.


--
David C. Rankin


Randall Schulz
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: [opensuse] regexp -- defference between < and  ?
    ... On Tuesday 29 April 2008 17:58, David C. Rankin wrote: ... With regular expressions, what is the difference between \< and \b? ...
    (SuSE)
  • Re: Question about Sun JAVAC
    ... I discuss this problem in my book "Design Your Own .Net Language and ... My book contains a discussion of regular expressions which attempts to ... I was last spring engaged in work which involved frequently searching ...
    (comp.programming)
  • Re: bash, grep, and regular expressions
    ... > |them lately using Jeffrey Friedl's book Mastering Regular Expressions ... > specifically requests listing all hidden files and directories, ... > the grep command. ...
    (Debian-User)
  • Re: Proof that Paul Holland was always wrong about me
    ... there are several posts you have made that have ... this is not anything different for/with you david, so indeed, the ... The difference of opinion between us is your assertion that negative ... I say those negative expressions are a result of their own ...
    (alt.med.fibromyalgia)
  • Re: Regex.IsMatch help
    ... You could use the Parse or the TryParse methods on the Single, Double or Decimal structs, depending on your needs and your framework version. ... if you wanted to find a regex for a more ... of regular expressions - expressions that will work in .NET may not ...
    (microsoft.public.dotnet.general)