I want to validate if a certain attribute is a valid regex. Is there some direct built in type in xml schema maybe xs:regex?
Otherwise is there a regex that defines valid regexes?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is, by definition, no regex that can validate regular expressions.
Regular expressions can match regular languages, they are not themselves a regular language. Much like there can be no regular expression to validate HTML or JavaScript.
To find out if a string is a legal regular expression, it’s easiest to try and create a regex object from it. In XSD itself this is impossible, so you’d need the help of an external tool.