tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: regexp word boundaries



On Mon, Dec 03, 2012 at 12:16:57AM +0100, Alistair Crooks wrote:
> 
> It's long been a pet peeve of mine that regexp matching for word
> boundaries has an annoying dependency on the implementation.

I'll add another (from memory!)

regexp word boundaries
                \<      \b      [[:<:]]
SYSV vi         works   not     not

Current Solaris vi might be the same.
IIRC \< and \> are interchangable.

One question that wasn't answered is what \<foo is actually looking
for in the places where it doesn't find the start of a word.
I'd have expected that \< be an unknown escape and so be equivalent
to just <, \bfoo might well be treated as a C escape.

I have wondered why I can't search for wors boundaries in any
versions of less, typing [[:<:]] is ridiculous!
Those patterns are only for scripts!

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index