Subject: Re: regex()
To: Nick Loman <nick@csosl.co.uk>
From: Chris G. Demetriou <cgd@cs.cmu.edu>
List: netbsd-help
Date: 02/22/1997 14:21:02
> I want to match some strings with wildcards a la "*blah*" with another
> string like "blah blah blah" and I can't get my head round the
> documentation :)

If you want to match "*blah*" to "blah blah blah", you probably want
glob(3), not any regular expression package.

"*blah*" isn't a regexp that'd match "blah blah blah", and it might
not even be a valid regexp at all.  (i'm not 100% sure about the rules
on leading *'s.)

A "*blah*"-like regexp to match "blah blah blah" would be ".*blah.*".
(I mention this, because if you've been trying to 'normal' regexp code
with "*blah*", you shouldn't expect it to find "blah blah blah".  8-)



cgd