Skip to content

Doubt about pattern

1 message · Peter J. Acklam

#
Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:

            
I should have said "many applications", not "most applications."
I use Solaris, and I don't know one Solaris application which allows
it, including egrep, oawk, and nawk.  And no version of Perl allows it.

GNU-tools allow it, but in an inconsistent way.  GNU Emacs treats `*x' as
`\*x' (match a literal star and a literal x), but GNU grep (version 2.5)
treats `*x' as `.*x' (match anything up to and including the first x),
which is something quite different.

It's a mess, it's inconsistent, and it's not portable.  I suggest people
stop using "*..." and use "\*..." or ".*..." depending on what is wanted.

Peter