http://qs321.pair.com?node_id=1168820


in reply to Difference between these regexes

2 and 3 are equivalent (and I'll bet that 2 is less efficient). 1 is also equivalent as-is. However, if you were to use these constructs as part of a larger regex, then 1 would not always be equivalent.

#!/usr/bin/perl -l $_ = '<left>no<right>yes'; /<(.*?)>y/s; print $1; /<([^>]*)>y/s; print $1; __END__ left>no<right right

- tye