Updated Answer to CSS Regex Question

I gave out a bit of duff information in my last post. Thanks Rasmus!

The code should have been:

string css = @"
.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
[feed], [feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , ,

My Related Documents
,

Related Amazon Books
The ZEN of CSS Design: Visual Enlightenment for the Web: / CSS Pocket Reference: / Professional CSS: / Eric Meyer on CSS: /

Related Images From Flickr
[[posterous-content:bioAlEnxGJJdFoBCoeAs]][[posterous-content:CkaoJgqDollBwqjDhubu]][[posterous-content:IFHEAseGqaesHtHtmdIs]][[posterous-content:rqxwsGqctxkEBAIlaFnB]]