The g regular expression modifier (called the global modifier) basically says to the engine not to stop parsing the string after the first match. If you were to omit the modifier, only the first instance of %0D%0A would be replaced (it might be desirable in some cases).