Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: RegEx & XML
06-19-2010, 06:19 PM #1
- Join Date
- Apr 2004
- Thanked 1 Time in 1 Post
RegEx & XML
Hey guys..... first off, I know I could use stuff like SimpleXML to do this, but I find they are too strict & using methods like below I don't have to worry about the file being perfect as it will just treat it as normal data.
Ok.... so anyway, was wondering if anyone could tell me why this code seems to be matching two items fields at once when I have set it to be ungreedy?
$pattern = '~<item>.*<title>(.+)</title>.*<link>(.+)</link>.*<description>(.+)</description>.*</item>~iU';
$res = preg_match_all($pattern, $data, $matches);
Any idea why?