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.
> 
> My thanks to the many people hwo helped out with this table, reproduced
> below, which shows what works, and what doesn't work, when attempting
> to match the zero-width pattern at a word boundary.
 
\b is a perl feature

man perlre explains about that, and \<
(BRE's versus ERE's, essentially).

> regexp word boundaries
>                 \<      \b      [[:<:]]
> perl            not     works   not

(see manpage, as noted)

> freebsd vile    not     works   not
> netbsd vile     works   not     not

without version numbers, I can only guess what you're referring to with
vile.  \< has been part of vile for a long time; \b is different from perl
(vile matches whitespace rather than a word boundary).  Both are in the
help-file.  See

        http://invisible-island.net/vile/vile-toc.html
        http://invisible-island.net/vile/vile-hlp.html#regular-expressions2

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Attachment: pgp1aBCZjFYvb.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index