The code has `[^\w-.]` but apparantly this is better `[^[\w\-.]` I get a warning in https://regex101.com/ that the RegExp is trying to match a range, when you want to match the '-' char.