I created a asp.net page. The rich text area and regular expression validator are existed in this page. I want to check the html span tag that is contained or not in the rich text area. And then, I开发者_运维百科 don't know how to write expression in regular expression validator. Please, help me.
You can figure out if there's a span
tag with C# in ASP.NET with the following regex:
bool existsSpan = Regex.IsMatch(areaText, "<span[^>]*>");
It searches for <span
then none or some chars that is not >
, and finally a >
.
精彩评论