Jump to content

matching sentences between HTML tags


daydreamer

Recommended Posts

<h1 id=unique>kdjkjd dwekjnd wk</h1>

<div> 
    match any whole sentences between the h1 and script tags only

</div>

<script>

 

How would I match the whole sentences in this scenario?

 

I am having trouble writing a reg ex for 'match from h1 to script tag'.

 

This will match data between the tags, but it includes line breaks (which I dont need):

>[^<]*\b([\s0-9a-zA-Z]+)[^<]*<

 

Cheers

 

Link to comment
https://forums.phpfreaks.com/topic/187468-matching-sentences-between-html-tags/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.