Hello, Thomas!

> > `+' isn't a portable literal.  Some implementations seem to use it as
> > a meta-character with the usual meaning, but without support for it
> > after `*'.

This was about grep, not egrep. GNU grep 2.4.2 (without -E) behaves
correctly, but the point was that some other implementations may behave
differently.

> unless I missed a response, so far all that's been demonstrated is that a
> newer version of GNU grep doesn't behave the same as other versions of
> grep.  It's probably a bug rather than a feature (bear in mind that
> GNU grep has to keep track of whether it's supposed to be fgrep, grep or
> egrep -- in the latter case, `+' would be a metacharacter).

I haven't checked the older versions, but this behaviour of GNU grep is
weird (it may or may not be a bug, dependent on the standard):

$ echo foo |./grep -E ' *+'
foo

POSIXLY_CORRECT doesn't change anything. I'm going to report this problem
to the GNU grep maintainers.

Regards,
Pavel Roskin

Reply via email to