Skip to main content
1 of 3
Stéphane Chazelas
  • 585.1k
  • 96
  • 1.1k
  • 1.7k

If there's only one occurrence of <ex>...</ex> per line:

sed -e :1 -e 's@\(<ex>.*\)&\(.*</ex>\)@\1#\2@;t1'
Stéphane Chazelas
  • 585.1k
  • 96
  • 1.1k
  • 1.7k