I use regex to match any string contains certain word (e.g: ‘dark’)
if (features[i].attributes.color.match(new RegExp(dark, "ig")) ) )
..
..
How can I modify it to match any string contains ‘dark; but NOT contains ‘blue’ ?
I tried:
if(
features[i].attributes.color.match(new RegExp(dark, "ig")) ) && !features[i].attributes.color.match(new RegExp(blue, "ig")) )
}
..
..
with no luck
1 Answer