Jump to content

regex and html parsing!


ShaolinF

Recommended Posts

Hi Guys

 

I am trying to get some content between some div tags but cannot do so thus far. Code and regex below:

 

<blockquote class="postcontent restore ">

content here

</blockquote>

 

Regex:

/<blockquote class=\"postcontent restore \">(.*?)<\/blockquote>/

 

Returns nothing.. Any ideas on where I am going wrong ?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/212022-regex-and-html-parsing/
Share on other sites

Are you sure you're trying it with the exact example you provided us? Because it works for me.

 

Note that you have a space on this line:

 

<blockquote class="postcontent restore ">

Within the class. You probably want to remove that from both the HTML and the pattern.

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.