grep and Regular expression correctness

Bob Bishop rb at
Mon Aug 23 12:45:43 UTC 2010


On 23 Aug 2010, at 12:51, chrisk-freebsd at 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:


matching eg b99b

Bob Bishop
rb at

More information about the freebsd-current mailing list