in reply to I'm looking for a one-liner filter 'twixt two regexes
perhaps I'm reading this too simply, and you mean something more complex by 'between two regexes', but it sounds like you just want:
perl -pi.bak -e "s/start(.*?)stop/$1/s" *.htmlwhere 'start' and 'stop' are the opening and closing matches, and with a g modifier as well if you want to replace more than once in each file.
update: hold on, that's stupid. sorry. you want to replace the whole file with the match, don't you, or capture that text somewhere else? d'uh. please ignore.
|
|---|