https://regexone.com/lesson/letters_and_digits?
RegexOne - Learn Regular Expressions - Lesson 1½: The 123s
Characters include normal letters, but digits as well. In fact, numbers 0-9 are also just characters and if you look at an ASCII table, they are listed sequentially. Over the various lessons, you will be introduced to a number of special metacharacters use
regexone.com
## 1. [0-9]+ : 연속된 숫자 매칭
. : 임의의 문자 하나
[abc] : 특정 문자 추출
[x-y] : 문자 범위를 이용한 추출
{m,n} : 문자 갯수 범위를 이용한 추출
\ : 특수 문자는 \를 이용해서 문자 그대로 추출(escape)
숫자, 점(.), 공백, 영어 소문자가 섞인 문자 추출하기 -> regex = '\d\.\s+[a-z]+'
^...S : 문자열의 시작(^)과 끝($) 지정해서 문자 추출
(a(bc)) : Capture - Sub-group
(abc|def) : Matches abc or def
'코딩?' 카테고리의 다른 글
정규표현식 예제풀기 (0) | 2022.01.03 |
---|---|
정규표현식 정리 + 예제 (0) | 2022.01.03 |
코딩의 []자도 모르는 자, 스파르타 코딩클럽 코딩 용어 해설 (0) | 2021.12.19 |
초보자인 나를 위한 파이썬(Python) 기초_파이썬 시작, 변수 (0) | 2021.12.18 |