Character | What does it do? | Example | Matches |
^ | Matches beginning of line | ^abc | abc, abcdef.., abc123 |
$ | Matches end of line | abc$ | my:abc, 123abc, theabc |
. | Match any character | a.c | abc, asg, a2c |
| | OR operator | abc|xyz | abc or xyz |
(...) | Capture anything matched | (a)b(c) | Captures 'a' and 'c' |
(?:...) | Non-capturing group | (a)b(?:c) | Captures 'a' but only groups 'c' |
[...] | Matches anything contained in brackets | [abc] | a,b, or c |
[^...] | Matches anything not contained in brackets | [^abc] | xyz, 123, 1de |
[a-z] | Matches any characters between 'a' and 'z' | [b-z] | bc, mind, xyz |
{x} | The exact 'x' amount of times to match | (abc){2} | abcabc |
{x,} | Match 'x' amount of times or more | (abc){2,} | abcabc, abcabcabc |
{x,y} | Match between 'x' and 'y' times. | (a){2,4} | aa, aaa, aaaaa |
* | Greedy match that matches everything in place of the * | ab*c | abc, abbcc, abcdc |
+ | Matches character before + one or more times | a+c | ac, aac, aaac, |
? | Matches the character before the ? zero or one times. Also, used as a non-greedy match | ab?c | ac, abc |
\ | Escape the character after the backslash or create an escape sequence. | a\sc | a c |
출처 : https://www.computerhope.com/jargon/r/regex.htm
'지식창고 > IT 지식' 카테고리의 다른 글
[UML] 시퀀스 다이어그램 (Sequence Diagram) (0) | 2023.01.27 |
---|---|
stderr 과 stdout 의 차이. 표준입출력의 버퍼 (3) | 2022.12.14 |
ping 명령어 옵션, tracert 명령어 (0) | 2022.10.26 |
x86-64 어셈블리어 (0) | 2022.10.20 |
19.7년 마다 돌아오는 GPS판 Y2K 버그 GPS Week Number Rollover (0) | 2022.10.17 |