[Nottingham] Perl Regular Expression Query.

nottingham@mailman.lug.org.uk nottingham at mailman.lug.org.uk
Fri Jan 17 15:51:02 2003


On Fri, 17 Jan 2003, Michael Erskine wrote:
> > I'm not by any imagination a perl programmer but from what I 
> > know about regex, the '?'s are erroneous. You should be using 
> > /@.*@.*@.*@/, in fact
> <snip>
> 
> With all due respect Peter, Sorry but no!

Ah yes, that ? modifier is a Perlism. For non-greedy matches, in standard
regex, use /@[^@]*@[^@]*@[^@]*@/.

Peter