I'm trying to come up with a SED greedy expression which ignores the stuff inside html quotes and ONLY matches the text of that element.
<p alt="100">100</p> #need to match only second 100
<img src="100.jpg">100</img> #need to match only second 100
<span alt="tel:100">100</span> #need to match only second 100
These are my attempts:
grep -E '(!?\")100(!?\")' html # this matches string as well as quotes
grep -E '[^\"]100[^\"]' html # this doesn't work either
Edit
Ok. I was trying to simplify the question but maybe that's wrong.
with command sed -r '/?????/__replaced__/g' file
i would need to see :
<p alt="100">__replaced__</p>
<img src="100.jpg">__replaced__</img>
<span alt="tel:100">__replaced__</span>