diff --git a/jquery.parse.js b/jquery.parse.js index 672e92a..53f7f9b 100644 --- a/jquery.parse.js +++ b/jquery.parse.js @@ -258,7 +258,7 @@ function tryParseFloat(num) { - var isNumber = num.match(/(\d+)(\.\d+)?|/)[0].length == num.length; + var isNumber = /^\d+(\.\d+)?$/.test(num); return isNumber ? parseFloat(num) : num; }