Args: patt (TYPE): NULL text (TYPE): NULL Returns: TODO Raises: NULL
(patt, text)
| 330 | |
| 331 | |
| 332 | def re_search(patt, text): |
| 333 | """ |
| 334 | |
| 335 | Args: |
| 336 | patt (TYPE): NULL |
| 337 | text (TYPE): NULL |
| 338 | |
| 339 | Returns: TODO |
| 340 | |
| 341 | Raises: NULL |
| 342 | """ |
| 343 | lst_result = [] |
| 344 | pos = 0 |
| 345 | while True: |
| 346 | match = re.search(patt, text[pos:]) |
| 347 | if match is None: |
| 348 | break |
| 349 | lst_result.append((match.start() + pos, match.end() + pos)) |
| 350 | pos = pos + match.end() + 1 |
| 351 | |
| 352 | return lst_result |
| 353 | |
| 354 | |
| 355 | CN_NUM = '〇一二三四五六七八九零壹贰叁肆伍陆柒捌玖貮两1234567890' |
no test coverage detected