Regex greediness: If you want to find the string one two three in "one two three" "four five six", your first thought might be to use m/"(.*)"/
This will return one two three" "four five six because the regex will match as many characters as it can. It will match until the last " it finds.
Instead, use m/"(.*?)"/, which will stop matching as soon as it can.
In reply to Re^3: Match variables : Beginner in perl -- webperl
by jbodoni
in thread Match variables : Beginner in perl
by Perl_Programmer1992
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |