Regular Expression (정규표현식) 정의 : 문자열에 대한 표현을 메타 문자로 표기하는 것
Regular Expression 실행 : 실제 문자열을 정규표현식과 매칭여부 검증
import re
| ^ | Matches the beginning of a line | 
| $ | Matches the end of the line | 
| . | Matches any character | 
| \s | Matches whitespace | 
| \S | Matches any non-whitespace character | 
| * | Repeats a character zero or more times 0회 이상 반복 | 
| *? | Repeats a character zero or more times (non-greedy) | 
| + | Repeats a character one or more times 1회 이상 반복 | 
| +? | Repeats a character one or more times (non-greedy) 1회 이상 반복 (최소 일치) | 
| [aeiou] | Matches a single character in the listed set | 
| [^XYZ] | Matches a single character not in the listed set | 
| [a-z0-9] | The set of characters can include a range | 
| ( | Indicates where string extraction is to start | 
| ) | Indicates where string extraction is to end ( ) 괄호 안의 내용을 그룹화, reference를 생성을 종료 | 
| match( ) | 문자열의 처음부터 정규식과 일치하는지 확인 | 
| search( ) | 정규식과 일치하는지 문자열 전체에서 검색 | 
| findall( ) | 정규식과 일치하는 모든 문자열(substring)을 리스트로 반환 | 
| finditer( ) | 정규식과 일치하는 모든 문자열(substring)을 iterator 객체로 반환 | 
| sub( ) | 정규식과 일치하면 변경 | 
| split( ) | 정규식과 일치하면 split 하여 반환 | 
'Biusiness Insight > Computer Science' 카테고리의 다른 글
| The Expert (Short Comedy Sketch) (0) | 2017.03.08 | 
|---|---|
| Must have: Technical skills (0) | 2017.02.09 | 
| [Algorithm] Introduction to Algorithms (0) | 2015.04.16 | 
| [w3schools.com] 개발 튜토리얼/레퍼런스 제공 무료 교육 사이트 (0) | 2015.03.29 | 
| 프레지(Prezi) 간단 사용 팁 (0) | 2014.12.19 |