python regex cheatsheet
Cheatsheet for python regex
Regex module
re
모듈이 정규식을 지원한다.
match
re.match()
함수는 주어진 패턴을 문자열의 시작지점부터 적용하여 매칭되는 결과가 있으면 match 객체를, 그렇지 않은 경우 None을 리턴한다.
> re.match(r'\d', 'a1c2')
==> None
> re.match(r'a', 'a1c2')
<_sre.SRE_Match object at 0x028543A0>