Skip to content

Commit

Permalink
add anchors to keyword regex
Browse files Browse the repository at this point in the history
  • Loading branch information
chengcq authored and Qix- committed Nov 30, 2021
1 parent b541d55 commit bea8702
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cs.get.rgb = function (string) {
var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
var rgba = /^rgba?\(\s*([+-]?\d+)\s*,?\s*([+-]?\d+)\s*,?\s*([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
var keyword = /(\w+)/;
var keyword = /^(\w+)$/;

var rgb = [0, 0, 0, 1];
var match;
Expand Down

0 comments on commit bea8702

Please sign in to comment.