Replace `regex` with `replacement` twice on `original`. This is used by string normalization to perform replaces on overlapping matches.
(regex: Pattern[str], replacement: str, original: str)
| 27 | |
| 28 | |
| 29 | def sub_twice(regex: Pattern[str], replacement: str, original: str) -> str: |
| 30 | """Replace `regex` with `replacement` twice on `original`. |
| 31 | |
| 32 | This is used by string normalization to perform replaces on |
| 33 | overlapping matches. |
| 34 | """ |
| 35 | return regex.sub(replacement, regex.sub(replacement, original)) |
| 36 | |
| 37 | |
| 38 | def has_triple_quotes(string: str) -> bool: |
no outgoing calls
no test coverage detected