Fix wildcard handling in get_hostmask_regex

Strings are immutable, so the result of `replace()` needs to be assigned. Also switched to a raw string for `'\*'` since it's cleaner (`'\*'` is an invalid escape sequence even though python handles it fine and without a warning)