I'm new to regex and I'm not able to do what I need.
Let's suppose we have this text:
<h1>Título</h1>
<h2>Los gatos felices</h2>
Existen una serie de gatos...
<h2 style="color:red" class="grande">los gatos: curiosidades</h2>
<p style='text-align: justify;' align='justify'>De por si
<strong>los gatos</strong> saben saltar y además
<strong>los perros odian a los gatos</strong>
</p>
And I need to get all tags that contains the "los gatos" text.
It should match 4 coincidences:
- <h2>Los gatos felices</h2>
- <h2 style="color:red" class="grande">los gatos: curiosidades</h2>
- <strong>los gatos</strong>
- <strong>los perros odian a los gatos</strong>
How can I solve it with a regular expression?
Edit:
I finally found what I need! I share it for anyone who might need it:
<(.*)([^<]*)>([^<]*)los gatos([^<]*)<\/\1>
tags. I need to get all tags that contains "los gatos" text. In this case would be
– Dalamar Oct 14 '16 at 06:25tags, but may be more tags like
, ...