pcre
Perl Compatible Regular Expressions (or pcre) are not supported by grep
. There is a pcregrep
that supports it, but traditional grep
on either FreeBSD or Linux lacks support.
This table compares single-letter pcre character class to POSIX names:
Word boundary support:
awk
can use(^|[^_[:alnum:]]|$)
grep
can use\(^\|[^_[:alnum:]]\|$\)
or\(\<\|\>\)
egrep
andgrep -E
can use(^|[^_[:alnum:]]|$)
or(\<|\>)
In pcre, the word boundary test (\b
) works for either the left- or right-side of a word. This is different than the \<
and \>
word boundary sequences supported by grep
which have to be used on the appropriate side of a word. This chapter focuses on pcre \b
word bounding for awk
. For information on \<
and \>
support for awk
, see the previous chapter.
Single-letter pcre support can be implemented in awk
for all platforms using:
Last updated