In regular expression
g is used for global search. If you not use this
g that expression only search and find with the first match. More details shown in the following example.
str.replace(/s/g,"#");
Example Program:- (Editor) 
Editor is Loading...
Output:-
Advertisement
Post a Comment for "Usage of Regular Expression g in javascript"