From 38fa3a43584fc1184b1ff6444de883b9f84a78d4 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 8 Oct 2013 22:11:46 -0700 Subject: [PATCH] Better regex matching --- jquery.parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }