Modified replacement regex to include multiple trailing slashes.