]> source.dussan.org Git - jquery.git/commitdiff
jquery selector: Replacing {0,1} for ? in a regex.
authorAriel Flesler <aflesler@gmail.com>
Mon, 5 Jan 2009 23:19:58 +0000 (23:19 +0000)
committerAriel Flesler <aflesler@gmail.com>
Mon, 5 Jan 2009 23:19:58 +0000 (23:19 +0000)
src/selector.js

index abe7562f06ade9e86cd3a0e1bdf8d83ba116747b..9cc75fc0e9568f4660fbc64baddf6e208a05f1e8 100644 (file)
@@ -246,7 +246,7 @@ var Expr = Sizzle.selectors = {
                ID: /#((?:[\w\u0128-\uFFFF_-]|\\.)+)/,
                CLASS: /\.((?:[\w\u0128-\uFFFF_-]|\\.)+)/,
                NAME: /\[name=['"]*((?:[\w\u0128-\uFFFF_-]|\\.)+)['"]*\]/,
-               ATTR: /\[((?:[\w\u0128-\uFFFF_-]|\\.)+)\s*(?:(\S{0,1}=)\s*(['"]*)(.*?)\3|)\]/,
+               ATTR: /\[((?:[\w\u0128-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\]/,
                TAG: /^((?:[\w\u0128-\uFFFF\*_-]|\\.)+)/,
                CHILD: /:(only|nth|last|first)-child\(?(even|odd|[\dn+-]*)\)?/,
                POS: /:(nth|eq|gt|lt|first|last|even|odd)\(?(\d*)\)?(?:[^-]|$)/,