Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- c++ 정규식
- c3 축 없애기
- c3 step graph
- CentOS7
- 1697
- influxdb 설치
- snmp
- 정규식 문자열 출력
- snmp test
- linux시간으로 변경
- semanage
- python subprocess
- InfluxDB
- telegraf
- g++ 업데이트
- gcc 업데이트
- 정규식 컴파일
- python os
- 정규식 활용
- 백준
- centos pyhon 설치
- c3 초
- c3 축 가리기
- selinux port 등록
- regex_search
- grafana dashboard
- c3 second
- subporcess path
- gcc regex
- python popen
Archives
- Today
- Total
리셋 되지 말자
python에서 re (regex) 사용 - 단어 추출 본문
정규식에서 \w 는 단어 문자를 뜻하며, ^는 not을 뜻한다.
word for word in re.sub('[^\w]', ' ', paragraph)
위 정규식은, 단어가 아닌 모든 문자를 공백으로 치환한다
참고 : https://dojang.io/mod/page/view.php?id=2438
파이썬 코딩 도장: 43.4 문자열 바꾸기
이번에는 정규표현식으로 특정 문자열을 찾은 뒤 다른 문자열로 바꾸는 방법을 알아보겠습니다. 문자열을 바꿀 때는 sub 함수를 사용하며 패턴, 바꿀 문자열, 문자열, 바꿀 횟수를 넣어줍니다.
dojang.io
참고: https://leetcode.com/problems/most-common-word/submissions/
Most Common Word - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
'Python' 카테고리의 다른 글
[python 공부] 소수 반올림, 올림, 버림 (0) | 2021.07.03 |
---|---|
정렬 (0) | 2021.06.13 |
람다 표현식 (0) | 2021.06.13 |
list 뒤짚기 - reverse() (0) | 2021.06.13 |
[python 문법] dict (0) | 2021.06.08 |
Comments