Please show more of your code. The following works for me as you seem to want:
> perl -wle "$_='foo s f pl bar';print for /^.+(s m e f|s f pl|s f).+$ +/;" s f pl
Most likely, $line does not contain what you think it contains, or maybe there is nothing after s f pl in your input string.
In reply to Re: match longest sequence in an "or" RE
by Corion
in thread match longest sequence in an "or" RE
by silentius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |