Edit: changed replace to split and join

because apparently replace only replace the first match and not all of
the matches.