Fixed replaceMatches, which had it backwards