/
outline.txt
236 lines (147 loc) · 3.6 KB
/
outline.txt
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
Learn some characters
1#################
Match one character
.
a
b
c
d
sd
gs
esdfsdfsdf
3##########################
Dropping Anchor
the carrot indicates a forced beginning of the line
a dollar sign indicates a forced end of the line
^drop$
drop
raise
4################################
Ends in Period
and escaped period indicates a period (\.)
a dollar sign indicates a forced end of the line
\.$
1.
!
1.0
5###########################
One of many characters
If you want any number of characters to match, list them in square brackets "e;[]"e;
6###########################
Does not end in period
a carrot inside of square brackets indicates all letters typed in the square brackets are not matched
most things inside square brackets don't need to be escaped.
A hyphen does need escape, because that represents a range eg, [0-9] or [a-0] for [a-zA-Z0-9]
[^.]$
07###########################
A period exists mid-sentence
A period represents any character.
A pattern is either a single character, or a group of characters inside a set of parenthesis
A pattern repeated one or more times is represented by the asterisk character + following the pattern: eg1: a+ would match a or aaaa. eg2: (ab)+ would match ab or ababab
8############################
Sometimes a comma
a pattern can pass if it matches or not with the ?
^1,?000$
1000
1,000
9############################
Ends with comma separated zeros
A pattern can such as (,000) can be specified to repeat many times, or not repeat at all with an asterisk
1(,000)*$
1
1,000
1,000,000
1,000,000,000
10############################
Contains only numbers
Individual numbers can be specified one at a time in square brackets [0123456789]
Number ranges can be specified with the hyphen in square brackets [0-9]
^[0-9]+$
1
223
23
a2
34cat
11#############################
A capture repeats
repetition is specified by placing the number of times a pattern repeats in curly brackets like ".{3}"
a pattern can represent a sequence of multiple characters if surrounded by parenthesis "(ab){3}"
Combine above information and use one or more repetition of any character for the pattern in the parenthesis (.+)
triple (.*){3}
triple aaa
triple bbb
triple ababab
12#############################
A integer is odd
[0-9]*[13579]
1
23
335
457
5222222222269
2
224
22222222226
13################################
A comma separated odd number, zero padded
([0-9]{3},)*([0-9]{2}[13579])
012,345
001
0001
14##########################
Contains One string OR another
. The Vertical Pipe for multiple regexs to be matched
cat|dog|bee
cat
dog
bee
tacocat
ape
15#########################
Pattern Captures and non captures
capture
AcaptureB
CCcaptureDD
(?:.+)(capture)(?:.+)
16#########################
Repeated Captures like variables
you can reference the first capture using \1
you can reference the second capture using \2
(.+)(.+)\2\1
abba
abccab
aaaa
abab
abcabc
17###############################
1st is 1st and 0th is 0th
(1st|2nd|3rd|[4567890]th).*\1
1st is 1st
2nd is 2nd
3rd ohh my 3rd
4th is 4th
5th is 5th
6th is best 6th
7th is 7th
8th is 8th
9th is 9th
0th is 0th
1st is 2nd
2nd is 3rd
4th is 5th
18####################################
First word and second word capture
([^ ]) ([^ ])
19###############################
First Last or Last, First
([^ ]) ([^ ])|([^ ]), ([^ ])
20#################################
extract numbers in array
([0-9])
21#################################
Extract Name Prefix
(.+\.) .+
Mr. Smith
Mrs. Steel
Ms. Ferris
23####################################