I'm not really sure if this is possible or not, but I'm sure someone here will know!
I have a file that contains text like this that has been produced by a script I wrote:
I would like to remove empty LocationMatch statements like the second one. Is there a way to use regex to match multiple lines and remove them, i.e. search for <LocationMatch ".*">/n</LocationMatch> and remove it? From what I've read, grep & awk don't seem to be able to do this, as they process files one line at a time.
If it's not possible with grep, awk etc. then what should I be using? Perl?
I have a file that contains text like this that has been produced by a script I wrote:
Code:
<LocationMatch "^/misc/favicon.ico.*"> SecRuleRemoveById 960015 SecRuleRemoveById 981203 </LocationMatch> <LocationMatch "^/misc/form.js.*"> </LocationMatch>
If it's not possible with grep, awk etc. then what should I be using? Perl?
Comment