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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.