Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32168

Regex to remove the css empty class

$
0
0
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

Viewing all articles
Browse latest Browse all 32168

Trending Articles