I have a one liner in vim which I regularly use for find and replace.
I now want to use it to remove tags - something like this but I looks like I need to escape the / I'm not sure what am I missing.
:%s~<Validator>*</Validator>~~g
I have a one liner in vim which I regularly use for find and replace.
I now want to use it to remove tags - something like this but I looks like I need to escape the / I'm not sure what am I missing.
:%s~<Validator>*</Validator>~~g
use awk.
awk -vRS="</Validator>" '{gsub(/<Validator>.*/,"") }1' file
The above removes from tag to tag, even if they span multiple lines.