0

Its probably super simple.

I want to match only where a certain word exists in between full <headers>

This is what i have so far.

(<h[d{1-6}](.itemprop.)(.*?)</h[d{1-6}]>)

I want it to match

<h1 class="test" itemprop="name">Test</h1>

AND

<h2 itemprop="name" class="test">Test</h2>

AND

<h6 class="test"><strong itemprop="Price">9,99</strong>Test</h6>

As it is now it only matches <h{1-6} itemprop etc

Mad Dog Tannen
  • 7,129
  • 5
  • 31
  • 55

1 Answers1

1

How about:

<h([1-6]).*?\bitemprop\b.*?</h\1>)
Toto
  • 89,455
  • 62
  • 89
  • 125