Skip to content

Commit 09cba37

Browse files
benmccannQix-
authored andcommitted
Reduce acceptable characters in keyword matching regex
1 parent 6ec8800 commit 09cba37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ cs.get.rgb = function (string) {
5151
var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
5252
var rgba = /^rgba?\(\s*([+-]?\d+)\s*,?\s*([+-]?\d+)\s*,?\s*([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
5353
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
54-
var keyword = /(\D+)/;
54+
var keyword = /(\w+)/;
5555

5656
var rgb = [0, 0, 0, 1];
5757
var match;

0 commit comments

Comments
 (0)