in reply to How can I build regexp with "not" assertion?
Given your example, if you are trying to do substitutions on all the lines which match all the 2-numbered lines, just ignore the "not parts" ...
$line =~ s/(pattern1).+?pattern2.+?\1/substitute/;
... Above will work since "pattern2" does not appear (per your example) in any lines identified by the 1s, so they remain unchanged.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I build regexp with "not" assertion?
by putnik (Novice) on Feb 17, 2008 at 17:36 UTC |