Salma Siddiqa

Salma Siddiqa

  • NA
  • 11
  • 3.5k

Regex to remove the css empty class

Feb 18 2013 5:58 AM
Hi All,

I have html style sheet in xml format., how can i remove the empty classes?

eg:
#span23
{

}

or
#span23{

}



I created 2 different pattern

Regex.Matches(strModifiedCSS.ToString(), @"[\#]+([a-z]+[0-9]+)", RegexOptions.IgnoreCase)


Regex.Matches(strModifiedCSS.ToString(), @"[\n]+\{(\s+)\}", RegexOptions.IgnoreCase)


but when i combined both it did not worked for me