Ticket #3698: selector.diff
File selector.diff, 1.2 KB (added by , 14 years ago) |
---|
-
selector.js
68 68 // The regular expressions that power the parsing engine 69 69 parse: [ 70 70 // Match: [@value='test'], [@foo] 71 /^(\[) *@?([\w:-]+) *([!*$^~=]*) *('?"?)( .*?)\4 *\]/,71 /^(\[) *@?([\w:-]+) *([!*$^~=]*) *('?"?)(\/?)(.*?)\5([ig]*)\4 *\]/, 72 72 73 73 // Match: :contains('foo') 74 74 /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, … … 340 340 z = jQuery.attr(a,m[2]) || ''; 341 341 342 342 if ( (type == "" && !!z || 343 type == "=" && z == m[5] || 344 type == "!=" && z != m[5] || 345 type == "^=" && z && !z.indexOf(m[5]) || 346 type == "$=" && z.substr(z.length - m[5].length) == m[5] || 347 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not ) 343 type == "=" && z == m[6] || 344 type == "!=" && z != m[6] || 345 type == "^=" && z && !z.indexOf(m[6]) || 346 type == "$=" && z.substr(z.length - m[6].length) == m[6] || 347 type == "*=" && z.indexOf(m[6]) >= 0 || 348 type == "~=" && !!z.match(new RegExp(m[6], m[7])) )^ not ) 348 349 tmp.push( a ); 349 350 } 350 351