Created
May 11, 2016 08:26
-
-
Save emilbayes/ba8e4301c0f1981a1b405190d7ec80eb to your computer and use it in GitHub Desktop.
CSS Selector for HTML RegExp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^([a-z]+)? #Element | |
(?:(\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*)| #classes | |
(?:#[A-Za-z][-A-Za-z0-9_:.]*)| # Id | |
(\[[a-zA-Z-]+(?:=["']?.*["']?)?\]))* #Attribute | |
(\{.*\})? #Text Content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html | |
.class | |
#id | |
section.class | |
input[type=text][disabled].class#id{hello} | |
input.class[type=text]#id[disabled] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment