RegularExpression DataAnnotation to validate Html tags
This regular expression validates html tags that include attributes could
someone correct this code to work in C# RegularExpression. The problem
with this expression is the quotes it stops at the first quote because
it's part of the expression doesn't any one know how to fix this or does
anyone have an alternative. P.S does anyone know of a C# .net regular
expression site to test their expressions
Here is the code:
[RegularExpression(@"</?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?>")]
No comments:
Post a Comment