Canonical solution omits backslashes in regex