Correctly escaping slashes in new regex.
Regex now happens in the right places for all cases.