I need to get value of all "title" attributes in html page. I use twig templates so source code can be like:
<a href="#" title="some {% func "smth" %} text">
I use this code to get title value:
/<[a-z]+[^>]*\s+(title|alt)\s*=\s*("[^"]*")/
but when title has {% func "smth" %}
i get next string:
"some {% func "
how to get full string ?
Update: DOM isnt a solution because it will interprete the example link above as
<a href="#" title="some {% func " smth text></a>