diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-05-13 13:32:48 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-05-13 13:32:48 +0200 |
commit | c0197097c4c1951ea5aa5392ff75473a7ae2e64d (patch) | |
tree | 37fb3893e368b43cbf45a73c769600db7c27a06a /src/regex.js | |
parent | cdf8e1467f5c6e0d4f9d62a7ca64d93b87a448e0 (diff) | |
download | svg.js-c0197097c4c1951ea5aa5392ff75473a7ae2e64d.tar.gz svg.js-c0197097c4c1951ea5aa5392ff75473a7ae2e64d.zip |
fixed string parsing in viewbox (#483), specs `SVG.ViewBox`
Diffstat (limited to 'src/regex.js')
-rw-r--r-- | src/regex.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/regex.js b/src/regex.js index 265a11a..ce89b9b 100644 --- a/src/regex.js +++ b/src/regex.js @@ -2,37 +2,37 @@ SVG.regex = { // Parse unit value numberAndUnit: /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i - + // Parse hex value , hex: /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i - + // Parse rgb value , rgb: /rgb\((\d+),(\d+),(\d+)\)/ - + // Parse reference id , reference: /#([a-z0-9\-_]+)/i - + // Parse matrix wrapper , matrix: /matrix\(|\)/g // Elements of a matrix , matrixElements: /,*\s+|,/ - + // Whitespace , whitespace: /\s/g // Test hex value , isHex: /^#[a-f0-9]{3,6}$/i - + // Test rgb value , isRgb: /^rgb\(/ - + // Test css declaration , isCss: /[^:]+:[^;]+;?/ - + // Test for blank string , isBlank: /^(\s+)?$/ - + // Test for numeric string , isNumber: /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i @@ -52,7 +52,7 @@ SVG.regex = { // Replaces all hyphens , hyphen: /\-/g - + // Replaces and tests for all path letters , pathLetters: /[MLHVCSQTAZ]/gi |