I have a textbox whose text is Regular expressions. i want to validate the regular expression (check if it is valid REGEX)before I use it.
how do I do it?
Printable View
I have a textbox whose text is Regular expressions. i want to validate the regular expression (check if it is valid REGEX)before I use it.
how do I do it?
Unless you want to write your own vaildator... your probably going to be stuck with trying to use it and handling the exception that is thrown if the RegEx is Invalid.
Sounds like you should get on the net and download one of the many validated text boxes that have already been created. Why reinvent the wheel when so many others already have? There may well be one in the code bank here, otherwise try the Code Project. I'm sure there are a squillion others as well.