regular expression doesn't work!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arentsen
Forum Newbie
Posts: 1
Joined: Tue Oct 26, 2004 11:33 am

regular expression doesn't work!!!!

Post 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);
mongol
Forum Newbie
Posts: 17
Joined: Tue Oct 26, 2004 8:34 am

Post by mongol »

You and I have similar problems. You should keep an eye on my thread.
hokiecsgrad
Forum Newbie
Posts: 17
Joined: Fri Oct 22, 2004 2:55 pm

Post 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.
Post Reply