regular expression doesn't work!!!!
Posted: Tue Oct 26, 2004 11:37 am
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);
$pattern1= "/(<WORD>)(.*)(<\/WORD>)/s";
$pattern2= "/(<WORD2>)(.*)(<\/WORD2>)/s";
preg_match_all ($pattern1, $contents, $words);