Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
((\s*([^,{]+)\s*,?\s*)*?){((\s*([^:]+)\s*:\s*([^;]+?)\s*;\s*)*?)}
|
Description |
will break out a valid CSS stylesheet into it's components. Groups on each style, all selectors, each selector within a comma delimited list of selectors, all properties, each property set, each property and each value. In other words, it breaks it all down for you :)
The only two problems I'm having with it:
A) it is ignorant of comment blocks. so if you have styles within a /* */ block, it'll pick those up.
B) the first style following a comment block is not parsed correctly (it incorrectly includes the comment as a selector
best thing to do would be to use another regexp to remove all comments before processing with this one
|
Matches |
div#main { position:relative; width:809px; margin-left:auto; margin-right:auto; padding:0; }
|
Non-Matches |
-----
|
Author |
Rating:
Nick Franceschina
|
Displaying page
of
pages;
Items to