from typing import List
import re


def make_pattern_from_keys(keys: List[str]) -> re.Pattern:
    """Make a re.Pattern that matches a list of strings."""
    keys = sorted(keys, key=lambda x: len(x), reverse=True)
    pattern_str = r'|'.join(re.escape(k) for k in keys)
    return re.compile(pattern_str)