Reputation: 1269
I've looked far and wide but couldn't figure this out: How can I use two modifiers, say i
and g
, with String.prototype.match()
?
I have this: var spChar = string.match(/[.:hm]/g);
How can I add the i
modifier too?
Upvotes: 0
Views: 67
Reputation: 85545
You can write after or before g, the ordering is not necessary:
var spChar = string.match(/[.:hm]/gi);
Upvotes: 3
Reputation: 413712
Just put both modifiers there:
var spChar = string.match(/[.:hm]/ig);
Upvotes: 3