exposed replaceMatchesInString, and added an example