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 ) 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 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 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 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
Archived
This topic is now archived and is closed to further replies.