in reply to I'm looking for a one-liner filter 'twixt two regexes
But I think what you mean is "I want to start printing when I see regex 1, and stop printing when I see regex 2"... (Edit: Aha, looking at your 2nd post, that does seem to be what you want)
If so, here goes:
Now, if start regex and end regex match on the same line, this won't print at all. You have to figure out if that's what you want or not.perl -i.bak -ne'if(/whateverStartRegexIs/){$print{$ARGV}=1} if(/whatev +erEndRegexIs/){$print{$ARGV}=0;} print if $print{$ARGV};' *.html
Also, if you have start...end...start...end in the same file, this will print two sets of lines for a given file. If that's not what you want, you could add a %done hash keyed on $ARGV as well...
Hope this helps!
--
Mike
|
|---|