Regex
-
Python/정규식 HOWTO코딩/Python 2024. 3. 4. 10:24
아래 내용은 Python reference를 번역한 것이다. 원본 내용은 제목의 링크를 참조한다. Regular Expression HOWTO Author: A.M. Kuchling Abstract This document is an introductory tutorial to using regular expressions in Python with the re module. It provides a gentler introduction than the corresponding section in the Library Reference. 이 문서는 re 모듈과 함께 Python에서 정규식을 사용하는 방법에 대한 입문 튜토리얼이다. Library Reference의 해당 섹션보다 덜 딱딱한 소개를 제공한다..
-
[Python/Module] RegEx코딩/Python 2022. 12. 22. 13:58
RegEx Regular Expression search pattern import re txt = "The rain in Spain" a = re.search("^The.*Spain$", txt) b = re.findall("ai", txt) RegEx Functions Function Description findall Returns a list containing all matches search Returns a Match object if there is a match anywhere in the string split Returns a list where the string has been split at each match sub Replaces one or many matches with ..