From b8427b841323fe2c8dc14584b0b10c30159d2023 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sat, 25 Apr 2020 15:20:44 +1000 Subject: sort out unused regex, add parser and regex tests, fix textable tests --- src/modules/core/regex.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/modules/core/regex.js b/src/modules/core/regex.js index 2b7b89e..b8adb83 100644 --- a/src/modules/core/regex.js +++ b/src/modules/core/regex.js @@ -8,7 +8,7 @@ export const hex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i export const rgb = /rgb\((\d+),(\d+),(\d+)\)/ // Parse reference id -export const reference = /(#[a-z0-9\-_]+)/i +export const reference = /(#[a-z_][a-z0-9\-_]*)/i // splits a transformation chain export const transforms = /\)\s*,?\s*/ @@ -22,18 +22,12 @@ export const isHex = /^#[a-f0-9]{3,6}$/i // Test rgb value export const isRgb = /^rgb\(/ -// Test css declaration -export const isCss = /[^:]+:[^;]+;?/ - // Test for blank string export const isBlank = /^(\s+)?$/ // Test for numeric string export const isNumber = /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i -// Test for percent value -export const isPercent = /^-?[\d.]+%$/ - // Test for image url export const isImage = /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i @@ -42,7 +36,7 @@ export const delimiter = /[\s,]+/ // The following regex are used to parse the d attribute of a path -// Matches all hyphens which are not after an exponent +// Matches all hyphens which are preceeded by something but not an exponent export const hyphen = /([^e])-/gi // Replaces and tests for all path letters -- cgit v1.2.3