Similar Question:
Case insensitive regex in JavaScript
Potential values to match:
- Mike Liam
- Joe Mike
- Mondal Mike Effron
I'm trying to find a match for every value that contains 'Mike' (case-insensitive).
This is what I attempted:
var searchTerm = "mike";
if(value.match(new RegExp(searchTerm, "gi"))) {
alert('Success');
}
However, this solution didn't work. Any suggestions?