added a replace regex method