View Single Post
Old 01-25-2010, 02:21 AM   #8 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

It's in the wrong spot.

Regular expressions use delimiters; characters that tell the compiler where the expression starts, and where it ends. Common delimeters are /, ~ or #, though it can technically be anything you choose. In the example I provided, the delimiter is ~, so the compiler will see the expression as;

php Code:
preg_match( '~(word|word|word)~' ....

The expression modifiers, such as i, need to be placed after the closing delimiter.

php Code:
preg_match( '~(' . implode( '|', $stopwords ) . ')~i' ....
delayedinsanity is offline  
Reply With Quote
The Following User Says Thank You to delayedinsanity For This Useful Post:
CΛSTΞX (01-25-2010)