No:
perl -le "$_=shift; m/fish(.*?)$/ and print $1" "one fish two fish thr +ee fish"
gives
two fish three fish
.*? will match as little as necessary, but it will not match as little as possible. The fish will still match at the leftmost position. Then, the .*? will match as little as necessary to make the match succeed, which still is the rest of the string.
In reply to Re^3: match last element instead of first??
by Corion
in thread match last element instead of first??
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |