일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- programmers
- Kaggle
- gs25
- 편스토랑
- 코로나19
- SW Expert Academy
- 자연어처리
- 우분투
- 맥북
- 편스토랑 우승상품
- 캐치카페
- github
- 파이썬
- 백준
- AI 경진대회
- PYTHON
- Real or Not? NLP with Disaster Tweets
- Docker
- 프로그래머스 파이썬
- Baekjoon
- Git
- 금융문자분석경진대회
- 더현대서울 맛집
- ubuntu
- leetcode
- 프로그래머스
- dacon
- ChatGPT
- hackerrank
- 데이콘
- Today
- Total
목록
반응형
정규식 (3)
솜씨좋은장씨
이 글에서는 자주 사용하는 정규식을 정리하려합니다. XXXX년 XX월 XX일 ( 년 월 일 형식 추출 정규식 ) import re value = "오늘은 2020년 12월 29일 입니다." pattern = r"\d+년 \d+월 \d+일" regex_result = re.search(pattern, value) result = regex_result.group() 특수문자 제거 정규식 import re regex_text = re.sub('[-=+,#/\?:^$.@*\"※~&%ㆍ!』\\‘|\(\)\[\]\`\'…》]', '', text) XX-XXX-XXXX | XX-XXXX-XXXX | XXX-XXX-XXXX | XXX-XXXX-XXXX ( 전화번호 추출 정규식 ) import re value = "내..
Implementatoiwhich converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and interprets them as a numerical value. The string can contain additional characters after ..
1일 1문제 99일차! 오늘의 문제는 백준의 문자열 분석입니다. 10820번: 문자열 분석 문자열 N개가 주어진다. 이때, 문자열에 포함되어 있는 소문자, 대문자, 숫자, 공백의 개수를 구하는 프로그램을 작성하시오. 각 문자열은 알파벳 소문자, 대문자, 숫자, 공백으로만 이루어져 있 www.acmicpc.net Solution import re while True: try: string = input() except: break if len(string) == 0: break elif len(string) != 0: somunja = re.findall('[a-z]', string) daemunja = re.findall('[A-Z]', string) sutja = re.findall('[0-9]', s..