def __init__(self, locale: str = DEFAULT_LOCALE, cache_size: int = 0) -> None:
        """
        Contains the regular expressions and functions to parse and split the input strings into tokens and eventually
        produce a datetime that is used by :class:`Arrow <arrow.arrow.Arrow>` internally.

        :param locale: the locale string
        :type locale: str
        :param cache_size: the size of the LRU cache used for regular expressions. Defaults to 0.
        :type cache_size: int
        """
        self.locale = locales.get_locale(locale)
        self._input_re_map = self._BASE_INPUT_RE_MAP.copy()
        self._input_re_map.update(
            {
                "MMMM": self._generate_choice_re(
                    self.locale.month_names[1:], re.IGNORECASE
                ),
                "MMM": self._generate_choice_re(
                    self.locale.month_abbreviations[1:], re.IGNORECASE
                ),
                "Do": re.compile(self.locale.ordinal_day_re),
                "dddd": self._generate_choice_re(
                    self.locale.day_names[1:], re.IGNORECASE
                ),
                "ddd": self._generate_choice_re(
                    self.locale.day_abbreviations[1:], re.IGNORECASE
                ),
                "d": re.compile(r"[1-7]"),
                "a": self._generate_choice_re(
                    (self.locale.meridians["am"], self.locale.meridians["pm"])
                ),
                # note: 'A' token accepts both 'am/pm' and 'AM/PM' formats to
                # ensure backwards compatibility of this token
                "A": self._generate_choice_re(self.locale.meridians.values()),
            }
        )
        if cache_size > 0:
            self._generate_pattern_re = lru_cache(maxsize=cache_size)(  # type: ignore
                self._generate_pattern_re
            )

        Contains the regular expressions and functions to parse and split the input strings into tokens and eventually
        produce a datetime that is used by :class:`Arrow <arrow.arrow.Arrow>` internally.

        :param locale: the locale string
        :type locale: str
        :param cache_size: the size of the LRU cache used for regular expressions. Defaults to 0.
        :type cache_size: int
        
arrow/parser.py