I am using jQuery & JavaScript!!
I have a string, for example
\"cubic-bezier(0.25, 0, 0.25, 1), ease-in, ease-out, linear\"
..
Match any comma not inside parentheses
var myString = "cubic-bezier(0.25, 0, 0.25, 1), ease-in, ease-out, linear";
var parts = myString.split(/\,\s?(?![^\(]*\))/);
console.log(parts)
/\,\s?(?![^\(]*\))/
\,
matches the character ,
literally \s?
matches any whitespace character. The ?
quantifier matches between zero and one times (?![^\(]*\))
Negative Lookahead asserts that the regex does not match a single character not present in the list below [^\(]
Quantifier. Matches between zero and unlimited times, as many times as possible\(
matches the character (
literally\)
matches the character )
literally