특정 문자
Page 7 - 괄호 중에 하나라도 있나요? [ ]
- Source : How do you do?
- Case 1
- Regular Expression : [oyu]
- First match: How do you do?
- All matches : How do you do?
- Case 2
- Regular Expression : [dH].
- First match: How do you do?
- All matches : How do you do?
- Case 3
- Regular Expression : [owy][yow]
- First match: How do you do?
- All matches : How do you do?
- Inside square brackets "[]" a list of character can be provided. The expression matches if any of these characters is found. The order of characters is insignificant(case 3)
- 괄호 세트가 문자 하나에 해당!
Page 8 - 범위가 필요해! -
- Source : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- Case 1
- Regular Expression : [C-K]
- First match: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- All matches : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- Case 2
- Regular Expression : [CDEFGHIJK]
- First match: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- All matches : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- Case 3
- Regular Expression : [a-d]
- First match: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- All matches : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- Case 4
- Regular Expression : [2-6]
- First match: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- All matches : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- Case 5
- Regular Expression : [C-Ka-d2-6]
- First match: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- All matches : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
Page 9 - ^은 다른 의미도 가진다! - not
- Source : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- Case 1
- Regular Expression : [^CDghi45]
- First match: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- All matches : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- Case 2
- Regular Expression : [^W-Z]
- First match: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- All matches : ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789
- If a character class starts with ^, then specified characters will not be selected.
'개발(레거시) > 정규 표현식 수련관(휴업)' 카테고리의 다른 글
서브 패턴 (0) | 2023.07.31 |
---|---|
모든 문자 (0) | 2023.07.30 |
위치와 이스케이핑 (0) | 2023.07.30 |
정규 표현식 패턴 기본 (0) | 2023.07.29 |