javascript - JS Regex: Replace all but first -


this question exact duplicate of:

how can make regex replaces occurrences of word first?
have webpage loads of text , header @ top. want make regex replaces occurrences of word first because don't want header change.

var count = 0; text = text.replace(myregex, function(match) {     count++;     if(count==1) {         return match;     }     else {         return myreplacedvalue;     } }); 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -