Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Regex and writing lines in fileby Corion (Patriarch) |
on Apr 30, 2013 at 11:19 UTC ( [id://1031388]=note: print w/replies, xml ) | Need Help?? |
If your three lines are not in the string buffer you are matching against already, you cannot solve this with regular expressions. I would maintain a "skip" count to know how many lines to skip:
If your three lines are in the string buffer already, a new line is defined by the newline character(s) appearing. So you would match three newline charachters with non-newline characters in between them to skip three lines forward. Without seeing code, it's hard to advise better.
In Section
Seekers of Perl Wisdom
|
|