이전 글에서 참조했던 예시를 가지고 이번에는 앞 3자리(지역번호)와 뒤 7자리를 각각 그룹화하여 따로 출력해 보자. >>> phoneNumRegex = re.compile(r'(\d\d\d)-(\d\d\d-\d\d\d\d)')>>> mo = phoneNumRegex.search('My number is 415-555-4242.')>>> mo.group(1)'415'>>> mo.group(2)'555-4242'>>> mo.group(0)'415-555-4242'>>> mo.group()'415-555-4242'예제 출처: Automate the Boring Stuff with Python (https://automatetheboringstuff.com/2e/chapter7/) 위와 같이 괄호를 이용해 (\..