일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 더현대서울 맛집
- Baekjoon
- ChatGPT
- dacon
- 데이콘
- gs25
- 우분투
- Docker
- leetcode
- hackerrank
- 백준
- 자연어처리
- SW Expert Academy
- ubuntu
- 파이썬
- 맥북
- 금융문자분석경진대회
- PYTHON
- Real or Not? NLP with Disaster Tweets
- 캐치카페
- 편스토랑 우승상품
- Kaggle
- github
- 편스토랑
- programmers
- 프로그래머스
- Git
- 코로나19
- AI 경진대회
- 프로그래머스 파이썬
- Today
- Total
목록
반응형
정규식 (3)
솜씨좋은장씨
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dyAK0w/btqRQRKktrE/vchQCXRAkFYIrnagC5Bmsk/img.png)
이 글에서는 자주 사용하는 정규식을 정리하려합니다. 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('[-=+,#/\?:^$.@*\"※~&%ㆍ!』\‘|
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/xIhI4/btqCoSdF3s8/MyGwmafQxqrhY9a0H72EoK/img.png)
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 ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/HaR2E/btqEbQllcoA/kTaMkZ8kDzOzdg27KZCZW1/img.png)
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..