from typing import List
import re


def file_exts_to_regex(exts: List[str], quoted: bool = False) -> str:
    """
    Turn list of file extensions into one regex
    """
    quote = '"' if quoted else ""
    globs = "|".join("\\.{}".format(re.escape(e)) for e in exts)
    return f"^{quote}.+({globs}){quote}$"