Regex to match text only inside html tags

Say I have the following anchor tag

<a href="" class="test-class">test</a>

I want a regex that only matches the test between the open and closing tag and ignores the attributes.

How can this be achieved? Would also like it to work across multiple lines if possible


  • Regex: you can select first sub grup.

Leave a Reply

Your email address will not be published. Required fields are marked *