import re
from collections.abc import Iterable, Sequence
from operator import itemgetter
from typing import Final

CS_ESCAPE: Final[re.Pattern[str]]
FIRST_ELEMENT: Final[itemgetter[int]]

def commonprefix(m: Iterable[str]) -> str: ...
def make_charset(letters: Iterable[str]) -> str: ...
def regex_opt_inner(strings: Sequence[str], open_paren: str) -> str: ...
def regex_opt(strings: Iterable[str], prefix: str = "", suffix: str = "") -> str: ...
