multiline preg_match_all failure
Posted: Sun Jun 17, 2007 9:53 am
I'm playing around with a little HTML parser I'm making. However, I'm running into a problem with preg_match_all.
If I run this pattern:
I get no matches. However, if I run this pattern (same one without the 's' modifier):
I get all single-line HTML tag matches. does anyone have any idea why it isn't working?
If I run this pattern:
Code: Select all
preg_match_all('#(<([^/>\s]+).*?>)(.*?)(</\2>)#si', $str, $matches);Code: Select all
preg_match_all('#(<([^/>\s]+).*?>)(.*?)(</\2>)#i', $str, $matches);