JavaScript RegExp g Modifier
JavaScript RegExp g Modifier
The g modifier is used for specifying the global match. In this modifier, it will find all matches but compared to only the first match.
Syntax:-
Its syntax is:- new RegExp("regexp", "g") OR /regexp/g
Return:-
Its return is:- matched value