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
|
---|
In Section
Seekers of Perl Wisdom