def str_to_regex(string):
    """Convert a string to a regex pattern with special treatment of an empty string."""
    if string:
        return string
    return "a^"         # This pattern should never match