regex1 5. Python 정규표현식 고급 활용 가이드 그룹핑, Lookaround, 치환(sub), 분리(split) 등을 포함한 정규표현식 심화 예제 정리입니다.1. 그룹(Grouping)과 findall()import retext = "John: 010-1111-2222; Jane: 010-3333-4444"matches = re.findall(r"(\w+): (\d{3}-\d{4}-\d{4})", text)print(matches) # [('John','010-1111-2222'),('Jane','010-3333-4444')]findall()은 그룹이 있으면 튜플 목록으로 반환합니다.2. 전방탐색(POSITIVE Lookahead)import res = "apple pie and banana split"result = re.findall(r"\w+(.. 2025. 7. 12. 이전 1 다음