How would you go about validating that a regex actually compiles and works, ie doesn't throw an error?
I'm creating an administration panel that has regex's submitted to it. Any ideas on how I would go about validating the submitted regex's to see if they work. When I say "see if they work" I mean if the regex's are valid and compile properly, not that they actually match data or not?

FYI, This would be in PHP.
How would you go about validating that a regex actually compiles and works, ie doesn't throw an error?
===

I'm creating an administration panel that has regex's submitted to it. Any ideas on how I would go about validating the submitted regex's to see if they work. When I say "see if they work" I mean if the regex's are valid and compile properly, not that they actually match data or not?

FYI, This would be in PHP.