Bhavesh Ghul

Bhavesh Ghul

  • 814
  • 1k
  • 55k

How to create regex in allow anything content using C# ?

Jul 3 2020 9:28 AM
  1. string underlineCss = "'" + "text-decoration: underline;" + "'";  
  2. var underlineSpan = @"<span style=" + underlineCss.Replace("'""\"") + ">(.*?)</span>";  
  3. var underlineRegex = new Regex(underlineSpan, RegexOptions.Compiled);  
  4. 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.

Answers (1)