RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
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: The rating for this expression. Nick Franceschina
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials