def compile_prefix_regex(entries):
if "<STR_LIT:(>" in entries:<EOL><INDENT>expression = "<STR_LIT:|>".join(<EOL>["<STR_LIT>" + re.escape(piece) for piece in entries if piece.strip()]<EOL>)<EOL>return re.compile(expression)<EOL><DEDENT>else:<EOL><INDENT>expression = "<STR_LIT:|>".join(["<STR_LIT>" + piece for piece in entries if piece.strip()])<EOL>return re.compile(expression)<EOL><DEDENT>
Compile a sequence of prefix rules into a regex object.

    entries (tuple): The prefix rules, e.g. spacy.lang.punctuation.TOKENIZER_PREFIXES.
    RETURNS (regex object): The regex object. to be used for Tokenizer.prefix_search.