import ast


def evaluate_string(string):
    """Piggyback on Python's string support so we can have backslash escaping
    and niceties like \n, \t, etc.

    This also supports:
    1. b"strings", allowing grammars to parse bytestrings, in addition to str.
    2. r"strings" to simplify regexes.
    """
    return ast.literal_eval(string)