Regex To Get Class Names From CSS 2.0

I have just read part of the CSS 2.0 spec and to tie in with one of my side projects about creating a CSS 2.0 parser in c#, I have created a regex [based off the spec] that should find all the class names in a CSS file..[-]?[_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]*I intend to create more regex’s over the next few days to parse all the other elements that appear inside the CSS spec.


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

<p>I have just read part of the CSS 2.0 spec and to tie in with one of <a href="http://www.kinlan.co.uk/2006/01/css-c-token-reader.html">my side projects </a>about creating a CSS 2.0 parser in c#, I have created a regex [based off the spec] that should find all the class names in a CSS file.<p />.[-]?[_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]*<p />I intend to create more regex's over the next few days to parse all the other elements that appear inside the CSS spec. Then once these are done I should be able to have a stab at creating a full <a href="http://www.kinlan.co.uk/2006/01/css-c-token-reader.html">CSS 2.0 parser</a>.<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-01T00:00:00+00:00) Regex To Get Class Names From CSS 2.0. Retrieved from https://www.scien.cx/2006/02/01/regex-to-get-class-names-from-css-2-0/

MLA
" » Regex To Get Class Names From CSS 2.0." Paul Kinlan | Sciencx - Wednesday February 1, 2006, https://www.scien.cx/2006/02/01/regex-to-get-class-names-from-css-2-0/
HARVARD
Paul Kinlan | Sciencx Wednesday February 1, 2006 » Regex To Get Class Names From CSS 2.0., viewed ,<https://www.scien.cx/2006/02/01/regex-to-get-class-names-from-css-2-0/>
VANCOUVER
Paul Kinlan | Sciencx - » Regex To Get Class Names From CSS 2.0. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2006/02/01/regex-to-get-class-names-from-css-2-0/
CHICAGO
" » Regex To Get Class Names From CSS 2.0." Paul Kinlan | Sciencx - Accessed . https://www.scien.cx/2006/02/01/regex-to-get-class-names-from-css-2-0/
IEEE
" » Regex To Get Class Names From CSS 2.0." Paul Kinlan | Sciencx [Online]. Available: https://www.scien.cx/2006/02/01/regex-to-get-class-names-from-css-2-0/. [Accessed: ]
rf:citation
» Regex To Get Class Names From CSS 2.0 | Paul Kinlan | Sciencx | https://www.scien.cx/2006/02/01/regex-to-get-class-names-from-css-2-0/ |

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.