diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-01-17 19:14:17 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-01-17 19:14:17 +0100 |
commit | 6f602f10613b81daf73fdf9604e4360c784b2c57 (patch) | |
tree | bc0096d408d3ea26de0f80f9836ef583945ec640 | |
parent | 63d9413c13facc410aa93a5a993fd0cb1c5ecaf7 (diff) | |
parent | 2131aa385ea8572e2580d094f467bf1403891122 (diff) | |
download | svg.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.js | 4 |
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 +} |