DISLEX |
02-22-2009 10:56 PM |
What am I doing wrong with this preg_match?
I'm working on a plugin and I'm trying to pull out quotes from a post message ($post[pagetext]). For some reason, it works if there's a quote->img->/img->/quote combination, but if there is any text inside the quote WITH an image, it won't pick it up.
here's my regex: $qc = preg_match_all("/(\[quote)(.*)(\[\/quote\])/i", $post[pagetext], $quotematches, PREG_SET_ORDER);
here are some examples of the regex results:
Quote:
Originally Posted by example post where $qc = 1
Quote:
Originally Posted by user
hey!
|
hey, how's it going?
|
In the above, it would detect the quoted message by "user"
Quote:
Originally Posted by another example where $qc = 1
Quote:
Originally Posted by user2
|
oh cool I'm not color blind
|
in the above, it still detects the quote
HOWEVER, in the following:
Quote:
Originally Posted by example where $qc = 0
Quote:
Originally Posted by user2
|
oh cool I'm not color blind
|
it doesn't detect the quote. I've noticed that it doesn't catch a quote if there's text AND an image inside of the quote. How on earth is that not a match?
|