Add regex pattern support to String.replace