Re: [PHP] Regex to catch ps (weird result)

2008-05-07 Thread Ryan S
clip preg_match_all('|p[^]*(.*)/p|Ui', $myText, $myArray); /clip Hey! Thanks for replying. Your preg_match_all works like a charm, but for some reason catches only 8 out of 9 paragraphs... its really weird. I have upped the test page to http://www.ezee.se/tests/para_regex2.php.txt so you

Re: [PHP] Regex to catch ps (weird result)

2008-05-07 Thread Shawn McKenzie
Ryan S wrote: clip preg_match_all('|p[^]*(.*)/p|Ui', $myText, $myArray); /clip Hey! Thanks for replying. Your preg_match_all works like a charm, but for some reason catches only 8 out of 9 paragraphs... its really weird. I have upped the test page to

Re: [PHP] Regex to catch ps (weird result)

2008-05-07 Thread Ryan S
clip http://www.ezee.se/tests/para_regex2.php.txt Yep, sorry... Just add the s preg_match_all('|p[^]*(.*)/p|Uis', $myText, $myArray); /clip Swett! It works! If you _do get time_, would love to know the actual meaning of |p[^]*(.*)/p|Uis because although I do appreciate the help and

Re: [PHP] Regex to catch ps (weird result)

2008-05-07 Thread Jon L.
Pretty close. The only thing I'd suggest is a different way of wording step 2: Can contain anything but '' until step 3. As for the switches/modifiers (Uis), check out: http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php U = ungreedy i = case-insensitive (|p| matches 'p' and/or