Answer the question
In order to leave comments, you need to log in
How did the quantifier affect the parenthesis in the regular expression?
var re = /#([a-f0-9]{3}){1,2}/gi;
var str = "color: #3f3; background-color: #AA00ef; and: #abcd";
alert( str.match(re) );
Answer the question
In order to leave comments, you need to log in
Well, then the first combination should occur 1 or 2 times. So either 3 or 6 digits
Open any online regular checker and read the explanation section. For example, on the site regex101.com
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question