I'm trying to do some pretty simple sedding of a file:
sed 's:(?<=<Type>)default(?=</Type>):super:' < myfile.xml
The concept's pretty simple, using positive lookaround, find the tags and replace the contents with "super". Unfortunately, it doesn't work, nothing is replaced. What am I doing wrong?
I'm looking to "edit" a file similar to this:
<Hello>
<World>
<Type>default</Type>
</World>
</Hello>
so that it looks like this:
<Hello>
<World>
<Type>super</Type>
</World>
</Hello>
(,)and?have no special meaning insedif not escaped. – enzotib Nov 10 '11 at 07:57<Type>default</Type>, expected output:<Type>super</Type>. I have to escape my parentheses? Why? – Naftuli Kay Nov 10 '11 at 07:59(?<=in the pattern if this is not present in the input? – enzotib Nov 10 '11 at 08:15