Skip to content

Instantly share code, notes, and snippets.

@mojombo
Created January 15, 2009 19:51
Show Gist options
  • Save mojombo/47566 to your computer and use it in GitHub Desktop.
Save mojombo/47566 to your computer and use it in GitHub Desktop.
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
}
}
--- a/pygments/lexers/web.py Sun Jan 04 22:41:03 2009 +0100
+++ b/pygments/lexers/web.py Thu Jan 15 11:52:01 2009 -0800
@@ -44,7 +44,7 @@
(r'//.*?\n', Comment),
(r'/\*.*?\*/', Comment),
(r'/(\\\\|\\/|[^/\n])*/[gim]+\b', String.Regex),
- (r'/(\\\\|\\/|[^/\n])*/(?=\s*[,);])', String.Regex),
+ (r'/(\\\\|\\/|[^/\n])*/(?=\s*[,);\n])', String.Regex),
(r'/(\\\\|\\/|[^/\n])*/(?=\s*\.[a-z])', String.Regex),
(r'[~\^\*!%&<>\|+=:;,/?\\-]+', Operator),
(r'[{}\[\]();.]+', Punctuation),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment