.class1{
color:pink;
}
.class2{
color:blue;
}";
string patt = @"\.[-]?[_a-zA-Z][_a-zA-Z0-9-]*|[^\0-\177]*\\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\\[^\n\r\f0-9a-f]*";
MatchCollection arr = Regex.Matches(css, patt);
}
The "arr" Collection will contain all the class names found in the input string. arr.Count will be the number of matches, and it can be indexed like so: arr[0].Value etc. etc.Sorry about that :)
Technorati Tags |
class names [feed], regex [feed], css [feed], split [feed], match [feed], index [feed] |
Related Wikipedia Documents |
Regular expression, Regular expression, Cascading Style Sheets, CSS Zen Garden |
My Related Documents |
C#, .Net Framework: CSS C# Token Reader, C#, .Net Framework: RE: Regex 101 Exercise S2 - Verify a string is a hex number |
Related Amazon Books |
The ZEN of CSS Design: Visual Enlightenment for the Web: View From Amazon UK/View From Amazon USA CSS Pocket Reference: View From Amazon UK/View From Amazon USA Professional CSS: View From Amazon UK/View From Amazon USA Eric Meyer on CSS: View From Amazon UK/View From Amazon USA |
Related Images From Flickr |
[[posterous-content:bioAlEnxGJJdFoBCoeAs]][[posterous-content:CkaoJgqDollBwqjDhubu]][[posterous-content:IFHEAseGqaesHtHtmdIs]][[posterous-content:rqxwsGqctxkEBAIlaFnB]] |