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 | 29 | 30 |
| 31 |
Tags
- swift
- javascript
- MySQL
- pandas
- Excel
- node.js
- 유니티
- Unity
- 날짜
- sqlite
- urllib
- 리눅스
- mssql
- MS-SQL
- port
- PyQt5
- IOS
- GIT
- ASP
- Linux
- tensorflow
- flutter
- 맛집
- PER
- 다이어트
- 함수
- PyQt
- ubuntu
- 라즈베리파이
- python
Archives
아미(아름다운미소)
python 필요없는 문자, 특수문자, 공백 제거는 정규식 본문
필요없는 문자, 특수문자, 공백 제거는 정규식
정규표현식은 특정언어에 구속되지 않고 어떤 규칙을 가지고 문자열을 바꾸거나 검색할 때 사용합니다. [] 안에 원하는 특수문자를 넣어주면 제거가 됩니다.import re
hp = u'010-2222#3333'
ret = re.sub('[-=.#/?:$}]', '', hp)
print ret
result 01022223333
'랭귀지 > python' 카테고리의 다른 글
| python 정규식 표현 중 자주 사용되는 패턴 (0) | 2018.10.07 |
|---|---|
| [ python] Extract sentences with specific words in a text file (0) | 2018.10.05 |
| Python Named colors in matplotlib (0) | 2018.10.03 |
| Python 슬라이싱으로 문자열 나누기 (0) | 2018.10.02 |
| Python type() Check Python data type (0) | 2018.10.01 |
Comments
