
April 7th, 2009, 10:31 AM
|
|
Registered User
|
|
Join Date: Apr 2009
Posts: 1
Time spent in forums: 49 m 6 sec
Reputation Power: 0
|
|
Preg_match on HTML Characters
Hey guys,
I'm a newbie to regex and have looked up a ton of tutorials and eventually came across this forum where it looks like I may get some help.
I'm pulling in an XML feed that has HTML characters in between the xml tags. I believe it's encoding the HTML characters.
For Example:
Code:
'<div>' is coming out as '& lt;div& gt;'
I want the content that is between these div tags.
Code:
For Example using: & lt;div& gt;This is my text!& lt;/div& gt;
I want simply, "This is my text!"
I'm trying:
Code:
preg_match("/& lt;div& gt;(.*)& lt;/div& gt;/", $string, $matches);
...but this does not seem to be working!
Anyone know whats wrong or how to format the reg expression for this scenario?!
Thanks so much in advance!
|