Merge pull request #2933 from Kabie/Regex.replace

Fix and enhance &Regex.replace/4

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>