-
Notifications
You must be signed in to change notification settings - Fork 131
/
rx_metachars
56 lines (56 loc) · 2 KB
/
rx_metachars
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## Metacharacter tests
. a y dot (.)
. \n n dot (.)
. '' n dot (.)
a\s+f abcdef n whitespace (\s)
ab\s+cdef ab cdef y whitespace (\s)
a\S+f abcdef y not whitespace (\S)
a\S+f ab cdef n not whitespace (\S)
^abc abcdef y start and end of string (^)
^abc abc\ndef y start and end of string (^)
^abc def\nabc n start and end of string (^)
def\n^abc def\nabc n start and end of string (^)
def$ abcdef y start and end of string ($)
def$ abc\ndef y start and end of string ($)
def$ def\nabc n start and end of string ($)
def$\nabc def\nabc n start and end of string (^)
abc\n$ abc\n y end of string ($)
abc$ abc\n y end of string with newline ($)
c\nd abc\ndef y logical newline (\n)
c\nd abc\rdef y logical newline matches \r
c\n+d abc\n\ndef y logical newline quantified
a\n+f abcdef n logical newline (\n)
c\nd abc\n\rdef n logical newline matches \n\r
c\nd abc\r\ndef y logical newline matches \r\n
b\nc abc\ndef n logical newline (\n)
\N a y not logical newline (\N)
a\Nc abc y not logical newline (\N)
\N '' n not logical newline (\N)
c\Nd abc\ndef n not logical newline (\N)
c\Nd abc\rdef n not logical newline (\N)
c\N+d abc\n\ndef n not logical newline (\N)
a\N+f abcdef y not logical newline (\N)
c\Nd abc\n\rdef n not logical newline (\N)
c\Nd abc\r\ndef n not logical newline (\N)
b\N\n abc\ndef y not logical newline (\N)
[a-d]|[b-e] c y alternation (|)
[a-d]|[d-e] c y alternation (|)
[a-b]|[b-e] c y alternation (|)
[a-b]|[d-e] c n alternation (|)
[a-d]+|[b-e]+ bcd y alternation (|)
a\w+f a=[ *f n word character
a\w+f abcdef y word character
a\W+f a&%- f y not word character
a\W+f abcdef n not word character
a\d+f abcdef n digit
ab\d+cdef ab42cdef y digit
a\D+f abcdef y not digit
a\D+f ab0cdef n not digit
\Ba\B a- n not boundary
a\Z a\n y basic \Z + (1)
a\Z a y basic \Z + (2)
a\Z ab n basic \Z - (1)
a\Z a\nb n basic \Z - (2)
a\z a y basic \z +
a\z a\n n basic \z - (1)
a\z a\nb n basic \z - (2)