aboutsummaryrefslogtreecommitdiffstats
path: root/src/regex.js
blob: adf82b49c89f8455d2df2b5b288d011ef86c7b92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Storage for regular expressions
SVG.regex = {
  /* parse unit value */
  unit:     /^([\d\.]+)([a-z%]{0,2})$/
  
  /* 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+),([\d\.]+)\)/
  
  /* parse hsb value */
, hsb:      /hsb\((\d+),(\d+),(\d+),([\d\.]+)\)/
  
  /* test hex value */
, isHex:    /^#[a-f0-9]{3,6}$/i
  
  /* test rgb value */
, isRgb:    /^rgb\(/
  
  /* test hsb value */
, isHsb:    /^hsb\(/
  
  /* test css declaration */
, isCss:    /[^:]+:[^;]+;?/
  
  /* test css property */
, isStyle:  /^font|text|leading|cursor/
  
  /* test for blank string */
, isBlank:  /^(\s+)?$/

}