Updated Answer to CSS Regex Question

<p>I gave out a bit of duff information in my last post. Thanks Rasmus!<p />The code should have been:<p />string css = @".class1{color:pink;}.class2{color:blue;}";string patt = @".[-]?[_a-zA-Z][_a-zA-Z0-9-]<em>|[^\0…


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan

<p>I gave out a bit of duff information in my last post. Thanks Rasmus!<p />The code should have been:<p />string css = @".class1{color:pink;}.class2{color:blue;}";string patt = @".[-]?[_a-zA-Z][_a-zA-Z0-9-]<em>|[^\0-\177]</em>\[0-9a-f]{1,6}(\r\n[ \n\r\t\f])?|\[^\n\r\f0-9a-f]*";MatchCollection arr = Regex.Matches(css, patt);}<p />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.<p />Sorry about that :)<p /></p>


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan


Print Share Comment Cite Upload Translate Updates
APA

Paul Kinlan | Sciencx (2006-02-06T00:00:00+00:00) Updated Answer to CSS Regex Question. Retrieved from https://www.scien.cx/2006/02/06/updated-answer-to-css-regex-question/

MLA
" » Updated Answer to CSS Regex Question." Paul Kinlan | Sciencx - Monday February 6, 2006, https://www.scien.cx/2006/02/06/updated-answer-to-css-regex-question/
HARVARD
Paul Kinlan | Sciencx Monday February 6, 2006 » Updated Answer to CSS Regex Question., viewed ,<https://www.scien.cx/2006/02/06/updated-answer-to-css-regex-question/>
VANCOUVER
Paul Kinlan | Sciencx - » Updated Answer to CSS Regex Question. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2006/02/06/updated-answer-to-css-regex-question/
CHICAGO
" » Updated Answer to CSS Regex Question." Paul Kinlan | Sciencx - Accessed . https://www.scien.cx/2006/02/06/updated-answer-to-css-regex-question/
IEEE
" » Updated Answer to CSS Regex Question." Paul Kinlan | Sciencx [Online]. Available: https://www.scien.cx/2006/02/06/updated-answer-to-css-regex-question/. [Accessed: ]
rf:citation
» Updated Answer to CSS Regex Question | Paul Kinlan | Sciencx | https://www.scien.cx/2006/02/06/updated-answer-to-css-regex-question/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.