Mailinglist Archive: opensuse (2532 mails)

< Previous Next >
Re: [opensuse] regexp -- defference between \< and \b ? (fwd)
  • From: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
  • Date: Thu, 1 May 2008 08:59:42 +0200 (CEST)
  • Message-id: <alpine.LNX.1.10.0805010859340.5623@xxxxxxxxxxxxxxxxxxxxxxxxx>
On Wednesday 2008-04-30 15:53, Randall R Schulz wrote:

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.

PCRE does not seem to know \<, so \b is what you would want these days.

\< and \> seem archaic, there does not seem to be a \<-based pattern
that could not be expressed with \b.
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >