Skip to content

Instantly share code, notes, and snippets.

@daemianmack
Created February 5, 2009 19:54
Show Gist options
  • Select an option

  • Save daemianmack/58958 to your computer and use it in GitHub Desktop.

Select an option

Save daemianmack/58958 to your computer and use it in GitHub Desktop.
var CSS="body { background: #fff; color: #000; font-family: Helvetica, Verdana, sans-serif; } .section { background: #e6b277; padding: 1em; margin: 1em; border: 1px solid #521302; } .example code { display: block; background: #e6d4a5; border: 1px solid #521302; padding: 0.8em; line-height: 1.4em; } #ex1 ul .first { font-size: 1.5em; color: #f0f; }";
var directChildMatch = CSS.match(/[a-zA-Z0-9\.-_\+\~#\s]*?\>\s?[a-zA-Z0-9\.-_\+\~#]*/gi);
if(directChildMatch) directChildMatch=directChildMatch.join(", ");
alert(directChildMatch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment