jQuery .match multiple words
Hello,
I have a variable .match and it is working fine when I am looking for one word or two words next to each other.
example one word:
- var car = !! entry.content.$t.match(/car/i);
"This is a blue car" --> true
"This is a red car" --> true
etc...
and "add" the color to my car:
- var car = !! entry.content.$t.match(/ blue car/i);
"This is a blue car" --> true
"This is a red car" --> false
etc...
But what I need the match of two separate words in a sentence like:
"This car has the color blue" --> true
"This is not a red car but it is blue" --> true
Thanks,