escape regexp-like characters when replacing by string