Javascript match find all occurrences

The Javascript’s function .match() will return an array of results matching your regular expression.

If you run into the case where only the first occurrence is returned from the match function then you’ll probably missing a “g” flag at the end of your regular expression.

That’s all you need.

Leave a Reply

Your email address will not be published. Required fields are marked *