Use (?!$):
$x = 'the quick brown fox jumps over the lazy fox';; print "<$1>" while $x =~ m[(......fox)]g;; <brown fox> < lazy fox> print "<$1>" while $x =~ m[(......fox)(?!$)]g;; <brown fox>
In reply to Re: How do I match a string that is NOT at the end of a line?
by BrowserUk
in thread How do I match a string that is NOT at the end of a line?
by davidfilmer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |