String.replace() invoked with function to avoid "$&" being replaced with search pattern.
Merge pull request #7 from yangit/master

fix to issue #6