Reputation: 3571
My Code:
I tried the following code
var str="I like green and want to build a GREENERY Earth with greening!";
var n=str.match(/green/g);
It is giving the result as
green,green
But I need the result as
green,GREEN,green
That is, I want to match both uppercase and lowercase letters. In this case, totally 3 green words are found.
Upvotes: 2
Views: 8145