- string underlineCss = "'" + "text-decoration: underline;" + "'";
- var underlineSpan = @"<span style=" + underlineCss.Replace("'", "\"") + ">(.*?)</span>";
- var underlineRegex = new Regex(underlineSpan, RegexOptions.Compiled);
- content = underlineRegex.Replace(content, "<u>$1</u>");
Regex : (.*?)
this regex not allow special character and space. so how any content allow in a-z A-z 0-9 special character and space and any other content allow.