ilava
asked on
How to validate the given boost regular expression
Hi All,
Im doing filtering the files/folders path. i use boost library to filter the given files/folders path. im using the Boost::Regex_Search() function for this. My question is how to validate the given regular expression is valid one. for example '^' is valid one. but if somebody giving the wrong one like "))))((()(()()". i need to validate this and give a alert to user that you are giving the wrog regular expression. i searched in Boost documentation and found regex_error_types. but im bit of confusing in that. is it possible to validate regular expressions using PHP or AJAX or Java script.
Please avoid ereg() functions.
Thanks in Advance...
- Prince
Im doing filtering the files/folders path. i use boost library to filter the given files/folders path. im using the Boost::Regex_Search() function for this. My question is how to validate the given regular expression is valid one. for example '^' is valid one. but if somebody giving the wrong one like "))))((()(()()". i need to validate this and give a alert to user that you are giving the wrog regular expression. i searched in Boost documentation and found regex_error_types. but im bit of confusing in that. is it possible to validate regular expressions using PHP or AJAX or Java script.
Please avoid ereg() functions.
Thanks in Advance...
- Prince
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
... ask the user...
In other languages, the regular expression can possibly be compiled on-the-fly, but the internal structure (a kind of finite automaton) is always built first. In other words, you will always be notified somehow if the syntax is bad.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.