Page 1 of 1

regular expression doesn't work!!!!

Posted: Tue Oct 26, 2004 11:37 am
by arentsen
I have two patterns, the first tag is recognized, but not the second. The result goes beyond the closing tag. I tried everything, but can't get it right.

$pattern1= "/(<WORD>)(.*)(<\/WORD>)/s";
$pattern2= "/(<WORD2>)(.*)(<\/WORD2>)/s";

preg_match_all ($pattern1, $contents, $words);

Posted: Tue Oct 26, 2004 12:01 pm
by mongol
You and I have similar problems. You should keep an eye on my thread.

Posted: Tue Oct 26, 2004 2:37 pm
by hokiecsgrad
If it's not too much trouble, could you post some of your code and some examples of strings that aren't matching? I'm not sure why the first pattern would work, but the second wouldn't unless there was something else happening in the code.