mirror of
https://github.com/jquery/jquery.git
synced 2026-02-17 01:31:55 -05:00
Clean up regexen; use common regex for numbers. Close gh-862.
This commit is contained in:
committed by
Dave Methvin
parent
74cc5b0984
commit
c14a6b385f
@@ -30,6 +30,9 @@ var
|
||||
return new jQuery.fn.init( selector, context, rootjQuery );
|
||||
},
|
||||
|
||||
// Used for matching numbers
|
||||
core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
|
||||
|
||||
// Used for detecting and trimming whitespace
|
||||
core_rnotwhite = /\S/,
|
||||
core_rspace = /\s+/,
|
||||
@@ -42,13 +45,13 @@ var
|
||||
rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
|
||||
|
||||
// Match a standalone tag
|
||||
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
||||
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
|
||||
|
||||
// JSON RegExp
|
||||
rvalidchars = /^[\],:{}\s]*$/,
|
||||
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
|
||||
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
|
||||
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
|
||||
|
||||
// Matches dashed string for camelizing
|
||||
rmsPrefix = /^-ms-/,
|
||||
|
||||
Reference in New Issue
Block a user