(
cls,
pattern: str,
)
| 4653 | |
| 4654 | @classmethod |
| 4655 | def _regex_capture_parts( |
| 4656 | cls, |
| 4657 | pattern: str, |
| 4658 | ) -> Optional[Tuple[str, str]]: |
| 4659 | normalized = pattern.lstrip("^") |
| 4660 | captures = [ |
| 4661 | (index, token) |
| 4662 | for token in ("(.*?)", "(.*)") |
| 4663 | if (index := normalized.find(token)) >= 0 |
| 4664 | ] |
| 4665 | if not captures: |
| 4666 | return None |
| 4667 | capture_index, capture_token = min(captures, key=lambda item: item[0]) |
| 4668 | return normalized[:capture_index], normalized[capture_index + len(capture_token) :] |
| 4669 | |
| 4670 | @classmethod |
| 4671 | def _regex_capture_end_literal_specs(cls, pattern: str) -> List[Tuple[str, bool]]: |
no outgoing calls
no test coverage detected