Replace or remove a portion of string with a regex

Thanks @ipazin that should work like a charm