> * Andy Williams (IMAP HILLWAY) <andy.williams at hillway.com> [2003-03-06 10:12]:
> > Actually went for a combination of all the above so as not to offend
> > anyone
> > :)
> > 
> > my @array = map { $_ =~ m/\[\%\s+(\S+)\s+\%\]/g } $copy;
> > 
> > Which seems to work.
> 
> ...Until you do something like:
> 
>   [% IF foo;
>       foo;
>      END %]
> 
> Which your regex will miss; maybe a regex like 
> 
>   /\[\%\s+(.+?)\s+\%\]/gs
> 
> would be a little better.
> 
> (darren)
> 

I thought a negated character class did match a newline - doesn't the /s 
modifier apply to what '.' matches only.

Won't (.+?) this result in more back tracking?

NIge


-- 
Nigel Hamilton
Turbo10 Metasearch Engine

email:  [EMAIL PROTECTED]
tel:    +44 (0) 207 987 5460
fax:    +44 (0) 207 987 5468
________________________________________________________________________________
http://turbo10.com              Search Deeper. Browse Faster.


Reply via email to