grep and Regular expression correctness

Bob Bishop rb at gid.co.uk
Mon Aug 23 12:45:43 UTC 2010


Hi,

On 23 Aug 2010, at 12:51, chrisk-freebsd at list.mightyreason.com wrote:

> [...]The hardest part of POSIX regular expressions is in picking out the
> correct captured subexpressions.  This makes programs like "sed"
> vulnerable to the bad regex.h engine that comes with the operating system.
> 
> Luckily grep does not need the captured subexpressions, and thus does
> not need the complexity that comes from the ideas behind TRE. [etc]

I think grep does potentially need the captured subexpressions, for eg:

\([abc]\)99\1

matching eg b99b

--
Bob Bishop
rb at gid.co.uk






More information about the freebsd-current mailing list