in reply to How do I match a string that is NOT at the end of a line?
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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I match a string that is NOT at the end of a line?
by 1nickt (Canon) on Jun 29, 2015 at 11:51 UTC | |
by BrowserUk (Patriarch) on Jun 29, 2015 at 11:55 UTC | |
by 1nickt (Canon) on Jun 29, 2015 at 12:00 UTC | |
by BrowserUk (Patriarch) on Jun 29, 2015 at 12:16 UTC | |
by 1nickt (Canon) on Jun 29, 2015 at 12:23 UTC |