I want to match any of these cases with a regex. I have the header text, but I need to match it with the (possible) corresponding HTML:
<h1>header title</h1>
<h2>site | header title</h2>
<h3 class="header">header title</h3>
<h2>header title 23 jan 2009</h2>
<h1>header title</h1>
I have this:
/(<(h1|h2|h3))(.+?)".$title."(.+?)(<\/\\2>)/i
But it seems to not always work, and don't see why.
Thanks