By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,890 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,890 IT Pros & Developers. It's quick & easy.

Getting warning whlie using preg_match....

ashitpro
Expert 100+
P: 542
Hi everybody..

The error I am getting is

"Warning: preg_match() [function.preg-match]: Compilation failed: missing terminating ] "

This happened because I'd supplied syntactically wrong regular expression to preg_match.
This expression are to be supplied by user, so I don't have control over it.
I just want to suppress this error. I don't want this warning on browser.
I also tried using try catch block but no luck.

any help?

Regards,
Ashish
Sep 25 '08 #1
Share this Question
Share on Google+
2 Replies


Atli
Expert 5K+
P: 5,058
Try adding a @ in front of the function. That usually silences warnings like these.
Sep 25 '08 #2

ashitpro
Expert 100+
P: 542
Try adding a @ in front of the function. That usually silences warnings like these.

Thanks...It's done...
Thanks again...
Sep 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.