summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-01-17 19:14:17 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-01-17 19:14:17 +0100
commit6f602f10613b81daf73fdf9604e4360c784b2c57 (patch)
treebc0096d408d3ea26de0f80f9836ef583945ec640
parent63d9413c13facc410aa93a5a993fd0cb1c5ecaf7 (diff)
parent2131aa385ea8572e2580d094f467bf1403891122 (diff)
downloadsvg.js-6f602f10613b81daf73fdf9604e4360c784b2c57.tar.gz
svg.js-6f602f10613b81daf73fdf9604e4360c784b2c57.zip
Merge pull request #444 from snowyplover/patch-1
Fix regex for isNumber
-rw-r--r--src/regex.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regex.js b/src/regex.js
index 1b26afd..d2e6c78 100644
--- a/src/regex.js
+++ b/src/regex.js
@@ -34,7 +34,7 @@ SVG.regex = {
, isBlank: /^(\s+)?$/
// Test for numeric string
-, isNumber: /^-?[\d\.]+$/
+, isNumber: /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i
// Test for percent value
, isPercent: /^-?[\d\.]+%$/
@@ -64,4 +64,4 @@ SVG.regex = {
// matches X
, X: /X/g
-} \ No newline at end of file
+}