Web Development



How Validate Regular Expression Syntax in PHP?

By simple.fatima ·
Is there any way to check and validate regular expression syntax before processing it in php.
I've a scenario in which user input regular expression and my piece of code process user input regular expression, but validation is necessary before processing it and message if invalid regular expression syntax.
such as, '/[abc]/'
User inputs, '/[abc/'
the code prompt an error because closing ']' is missing!
Kindly suggest solution!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums