Problem with preg_match

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
winsonlee
Forum Commoner
Posts: 76
Joined: Thu Dec 11, 2003 8:49 pm

Problem with preg_match

Post by winsonlee »

I got this warning msg when i try running preg_match function. Just wondering what does this error msg means ?


Warning: preg_match() [function.preg-match]: Compilation failed: missing ) at offset 29 in C:\Program Files\xampp\htdocs\tree4.php on line 97

Warning: preg_match() [function.preg-match]: Unknown modifier '1' in C:\Program Files\xampp\htdocs\tree4.php on line 97

Code: Select all

if(preg_match("/(.*?)$dbarray[0](.*?).pdf/i",$results[$z])){

}
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

'/(.*?)' . preg_quote($dbarray[0], '/') . '(.*?)\\.pdf/i'
maybe?
winsonlee
Forum Commoner
Posts: 76
Joined: Thu Dec 11, 2003 8:49 pm

Post by winsonlee »

Thanks.
It does solve the problem.
Post Reply