Handle escaped slashes in regular expressions