RegexpMode
: string
in package
Regex-evaluation mode selector for `MagicFilter::regexp(...)`.
Mirrors upstream magic_filter.magic.RegexpMode
(magic_filter/magic.py:33-38). Python upstream uses string constants;
we use a typed enum for type safety and PHPStan-friendliness.
Mode semantics — PHP-side mappings since upstream relies on Python's
re.Pattern API and PHP's PCRE wrappers behave differently:
MATCH→preg_match($pattern, $subject)anchored at the start of the subject (we automatically prepend\Awhen building the pattern).FULLMATCH→preg_matchanchored at both ends (we wrap the pattern in\A(?:…)\z).SEARCH→preg_match($pattern, $subject)un-anchored — the default PCRE behaviour.FINDALL→preg_match_allreturning the list of matched strings.FINDITER→ same as FINDALL in PHP; we materialise rather than expose an iterator because PHP'spreg_match_allis single-shot. Functionally identical to FINDALL from the user's perspective.