Page 1 of 1

Problem with preg_match

Posted: Thu Sep 14, 2006 5:45 pm
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])){

}

Posted: Thu Sep 14, 2006 8:24 pm
by feyd

Code: Select all

'/(.*?)' . preg_quote($dbarray[0], '/') . '(.*?)\\.pdf/i'
maybe?

Posted: Thu Sep 14, 2006 8:37 pm
by winsonlee
Thanks.
It does solve the problem.