terrordrone Posted September 23, 2009 Share Posted September 23, 2009 Hello Im taking regex as input i need to check if the regex is valid.. any ideas on how do i go about it.. ? ( searched a lot in vain ) Quote Link to comment https://forums.phpfreaks.com/topic/175187-checking-if-a-regex-is-valid/ Share on other sites More sharing options...
Mark Baker Posted September 23, 2009 Share Posted September 23, 2009 Execute a preg_match using it, and trap for the return boolean Quote Link to comment https://forums.phpfreaks.com/topic/175187-checking-if-a-regex-is-valid/#findComment-923340 Share on other sites More sharing options...
Zane Posted September 23, 2009 Share Posted September 23, 2009 what's your regex Quote Link to comment https://forums.phpfreaks.com/topic/175187-checking-if-a-regex-is-valid/#findComment-923341 Share on other sites More sharing options...
terrordrone Posted September 23, 2009 Author Share Posted September 23, 2009 @mark foolish me.. didnt check the ending of the description for the return value in the doc for preg_match :| .. anyway will try using that ... @zanus : did not get you.. i just need to validate a regex input by a user.. whethere its a valid one.. for eg.. "$^12" is not a valid regex Quote Link to comment https://forums.phpfreaks.com/topic/175187-checking-if-a-regex-is-valid/#findComment-923342 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.