tech-userlevel archive

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

regexp word boundaries



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.

regexp word boundaries
                \<      \b      [[:<:]]
awk             not     not     not
gawk            works   not     not
mawk            not     not     not
bsd grep        not     not     works
gnu grep        works   works   not
ed              not     not     works
emacs20         works   works   not
emacs22         works   works   not
less            not     not     works
nvi             works   not     works
perl            not     works   not
pcregrep        not     works   not
sed             not     not     works
freebsd vile    not     works   not
netbsd vile     works   not     not
vim             works   not     not
solaris awk     not     not     not  
solaris ed      works   not     not
solaris grep    not     not     not
solaris sed     works   not     not

Regards,
Alistair


Home | Main Index | Thread Index | Old Index