Created
April 10, 2021 01:51
-
-
Save Park-Developer/48d8937aa4c91c072ad9b729c71b7d21 to your computer and use it in GitHub Desktop.
re module : search()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
text = "문의사항이 있으면 032-232-3245 으로 연락주시기 바랍니다." | |
regex = re.compile(r'\d\d\d-\d\d\d-\d\d\d\d') | |
matchobj = regex.search(text) | |
phonenumber = matchobj.group() | |
print(phonenumber) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
출처 : http://pythonstudy.xyz/python/article/401-%EC%A0%95%EA%B7%9C-%ED%91%9C%ED%98%84%EC%8B%9D-Regex