line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. |
2
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
3
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# This file was generated from the 'perl.xml' file of the syntax highlight |
6
|
|
|
|
|
|
|
# engine of the kate text editor (http://www.kate-editor.org |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#kate xml version 1.20 |
9
|
|
|
|
|
|
|
#kate version 2.4 |
10
|
|
|
|
|
|
|
#kate author Anders Lund (anders@alweb.dk) |
11
|
|
|
|
|
|
|
#generated: Sun Feb 3 22:02:05 2008, localtime |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Syntax::Highlight::Engine::Kate::Perl; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
4
|
|
23
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
92
|
|
18
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
90
|
|
19
|
4
|
|
|
4
|
|
16
|
use base('Syntax::Highlight::Engine::Kate::Template'); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
25707
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
9
|
|
|
9
|
0
|
702
|
my $proto = shift; |
23
|
9
|
|
33
|
|
|
45
|
my $class = ref($proto) || $proto; |
24
|
9
|
|
|
|
|
44
|
my $self = $class->SUPER::new(@_); |
25
|
9
|
|
|
|
|
140
|
$self->attributes({ |
26
|
|
|
|
|
|
|
'Comment' => 'Comment', |
27
|
|
|
|
|
|
|
'Data' => 'Normal', |
28
|
|
|
|
|
|
|
'Data Type' => 'DataType', |
29
|
|
|
|
|
|
|
'Decimal' => 'DecVal', |
30
|
|
|
|
|
|
|
'Float' => 'Float', |
31
|
|
|
|
|
|
|
'Function' => 'Function', |
32
|
|
|
|
|
|
|
'Hex' => 'BaseN', |
33
|
|
|
|
|
|
|
'Keyword' => 'Keyword', |
34
|
|
|
|
|
|
|
'Normal Text' => 'Normal', |
35
|
|
|
|
|
|
|
'Nothing' => 'Comment', |
36
|
|
|
|
|
|
|
'Octal' => 'BaseN', |
37
|
|
|
|
|
|
|
'Operator' => 'Operator', |
38
|
|
|
|
|
|
|
'Pattern' => 'Others', |
39
|
|
|
|
|
|
|
'Pattern Character Class' => 'BaseN', |
40
|
|
|
|
|
|
|
'Pattern Internal Operator' => 'Char', |
41
|
|
|
|
|
|
|
'Pod' => 'Comment', |
42
|
|
|
|
|
|
|
'Pragma' => 'Keyword', |
43
|
|
|
|
|
|
|
'Special Variable' => 'Variable', |
44
|
|
|
|
|
|
|
'String' => 'String', |
45
|
|
|
|
|
|
|
'String (interpolated)' => 'String', |
46
|
|
|
|
|
|
|
'String Special Character' => 'Char', |
47
|
|
|
|
|
|
|
}); |
48
|
9
|
|
|
|
|
91
|
$self->listAdd('functions', |
49
|
|
|
|
|
|
|
'abs', |
50
|
|
|
|
|
|
|
'accept', |
51
|
|
|
|
|
|
|
'alarm', |
52
|
|
|
|
|
|
|
'atan2', |
53
|
|
|
|
|
|
|
'bind', |
54
|
|
|
|
|
|
|
'binmode', |
55
|
|
|
|
|
|
|
'bless', |
56
|
|
|
|
|
|
|
'caller', |
57
|
|
|
|
|
|
|
'chdir', |
58
|
|
|
|
|
|
|
'chmod', |
59
|
|
|
|
|
|
|
'chomp', |
60
|
|
|
|
|
|
|
'chop', |
61
|
|
|
|
|
|
|
'chown', |
62
|
|
|
|
|
|
|
'chr', |
63
|
|
|
|
|
|
|
'chroot', |
64
|
|
|
|
|
|
|
'close', |
65
|
|
|
|
|
|
|
'closedir', |
66
|
|
|
|
|
|
|
'connect', |
67
|
|
|
|
|
|
|
'cos', |
68
|
|
|
|
|
|
|
'crypt', |
69
|
|
|
|
|
|
|
'dbmclose', |
70
|
|
|
|
|
|
|
'dbmopen', |
71
|
|
|
|
|
|
|
'defined', |
72
|
|
|
|
|
|
|
'delete', |
73
|
|
|
|
|
|
|
'die', |
74
|
|
|
|
|
|
|
'dump', |
75
|
|
|
|
|
|
|
'endgrent', |
76
|
|
|
|
|
|
|
'endhostent', |
77
|
|
|
|
|
|
|
'endnetent', |
78
|
|
|
|
|
|
|
'endprotoent', |
79
|
|
|
|
|
|
|
'endpwent', |
80
|
|
|
|
|
|
|
'endservent', |
81
|
|
|
|
|
|
|
'eof', |
82
|
|
|
|
|
|
|
'eval', |
83
|
|
|
|
|
|
|
'exec', |
84
|
|
|
|
|
|
|
'exists', |
85
|
|
|
|
|
|
|
'exit', |
86
|
|
|
|
|
|
|
'exp', |
87
|
|
|
|
|
|
|
'fcntl', |
88
|
|
|
|
|
|
|
'fileno', |
89
|
|
|
|
|
|
|
'flock', |
90
|
|
|
|
|
|
|
'fork', |
91
|
|
|
|
|
|
|
'format', |
92
|
|
|
|
|
|
|
'formline', |
93
|
|
|
|
|
|
|
'getc', |
94
|
|
|
|
|
|
|
'getgrent', |
95
|
|
|
|
|
|
|
'getgrgid', |
96
|
|
|
|
|
|
|
'getgrnam', |
97
|
|
|
|
|
|
|
'gethostbyaddr', |
98
|
|
|
|
|
|
|
'gethostbyname', |
99
|
|
|
|
|
|
|
'gethostent', |
100
|
|
|
|
|
|
|
'getlogin', |
101
|
|
|
|
|
|
|
'getnetbyaddr', |
102
|
|
|
|
|
|
|
'getnetbyname', |
103
|
|
|
|
|
|
|
'getnetent', |
104
|
|
|
|
|
|
|
'getpeername', |
105
|
|
|
|
|
|
|
'getpgrp', |
106
|
|
|
|
|
|
|
'getppid', |
107
|
|
|
|
|
|
|
'getpriority', |
108
|
|
|
|
|
|
|
'getprotobyname', |
109
|
|
|
|
|
|
|
'getprotobynumber', |
110
|
|
|
|
|
|
|
'getprotoent', |
111
|
|
|
|
|
|
|
'getpwent', |
112
|
|
|
|
|
|
|
'getpwnam', |
113
|
|
|
|
|
|
|
'getpwuid', |
114
|
|
|
|
|
|
|
'getservbyname', |
115
|
|
|
|
|
|
|
'getservbyport', |
116
|
|
|
|
|
|
|
'getservent', |
117
|
|
|
|
|
|
|
'getsockname', |
118
|
|
|
|
|
|
|
'getsockopt', |
119
|
|
|
|
|
|
|
'glob', |
120
|
|
|
|
|
|
|
'gmtime', |
121
|
|
|
|
|
|
|
'goto', |
122
|
|
|
|
|
|
|
'grep', |
123
|
|
|
|
|
|
|
'hex', |
124
|
|
|
|
|
|
|
'import', |
125
|
|
|
|
|
|
|
'index', |
126
|
|
|
|
|
|
|
'int', |
127
|
|
|
|
|
|
|
'ioctl', |
128
|
|
|
|
|
|
|
'join', |
129
|
|
|
|
|
|
|
'keys', |
130
|
|
|
|
|
|
|
'kill', |
131
|
|
|
|
|
|
|
'last', |
132
|
|
|
|
|
|
|
'lc', |
133
|
|
|
|
|
|
|
'lcfirst', |
134
|
|
|
|
|
|
|
'length', |
135
|
|
|
|
|
|
|
'link', |
136
|
|
|
|
|
|
|
'listen', |
137
|
|
|
|
|
|
|
'localtime', |
138
|
|
|
|
|
|
|
'lock', |
139
|
|
|
|
|
|
|
'log', |
140
|
|
|
|
|
|
|
'lstat', |
141
|
|
|
|
|
|
|
'map', |
142
|
|
|
|
|
|
|
'mkdir', |
143
|
|
|
|
|
|
|
'msgctl', |
144
|
|
|
|
|
|
|
'msgget', |
145
|
|
|
|
|
|
|
'msgrcv', |
146
|
|
|
|
|
|
|
'msgsnd', |
147
|
|
|
|
|
|
|
'oct', |
148
|
|
|
|
|
|
|
'open', |
149
|
|
|
|
|
|
|
'opendir', |
150
|
|
|
|
|
|
|
'ord', |
151
|
|
|
|
|
|
|
'pack', |
152
|
|
|
|
|
|
|
'package', |
153
|
|
|
|
|
|
|
'pipe', |
154
|
|
|
|
|
|
|
'pop', |
155
|
|
|
|
|
|
|
'pos', |
156
|
|
|
|
|
|
|
'print', |
157
|
|
|
|
|
|
|
'printf', |
158
|
|
|
|
|
|
|
'prototype', |
159
|
|
|
|
|
|
|
'push', |
160
|
|
|
|
|
|
|
'quotemeta', |
161
|
|
|
|
|
|
|
'rand', |
162
|
|
|
|
|
|
|
'read', |
163
|
|
|
|
|
|
|
'readdir', |
164
|
|
|
|
|
|
|
'readline', |
165
|
|
|
|
|
|
|
'readlink', |
166
|
|
|
|
|
|
|
'recv', |
167
|
|
|
|
|
|
|
'redo', |
168
|
|
|
|
|
|
|
'ref', |
169
|
|
|
|
|
|
|
'rename', |
170
|
|
|
|
|
|
|
'reset', |
171
|
|
|
|
|
|
|
'return', |
172
|
|
|
|
|
|
|
'reverse', |
173
|
|
|
|
|
|
|
'rewinddir', |
174
|
|
|
|
|
|
|
'rindex', |
175
|
|
|
|
|
|
|
'rmdir', |
176
|
|
|
|
|
|
|
'scalar', |
177
|
|
|
|
|
|
|
'seek', |
178
|
|
|
|
|
|
|
'seekdir', |
179
|
|
|
|
|
|
|
'select', |
180
|
|
|
|
|
|
|
'semctl', |
181
|
|
|
|
|
|
|
'semget', |
182
|
|
|
|
|
|
|
'semop', |
183
|
|
|
|
|
|
|
'send', |
184
|
|
|
|
|
|
|
'setgrent', |
185
|
|
|
|
|
|
|
'sethostent', |
186
|
|
|
|
|
|
|
'setnetent', |
187
|
|
|
|
|
|
|
'setpgrp', |
188
|
|
|
|
|
|
|
'setpriority', |
189
|
|
|
|
|
|
|
'setprotoent', |
190
|
|
|
|
|
|
|
'setpwent', |
191
|
|
|
|
|
|
|
'setservent', |
192
|
|
|
|
|
|
|
'setsockopt', |
193
|
|
|
|
|
|
|
'shift', |
194
|
|
|
|
|
|
|
'shmctl', |
195
|
|
|
|
|
|
|
'shmget', |
196
|
|
|
|
|
|
|
'shmread', |
197
|
|
|
|
|
|
|
'shmwrite', |
198
|
|
|
|
|
|
|
'shutdown', |
199
|
|
|
|
|
|
|
'sin', |
200
|
|
|
|
|
|
|
'sleep', |
201
|
|
|
|
|
|
|
'socket', |
202
|
|
|
|
|
|
|
'socketpair', |
203
|
|
|
|
|
|
|
'sort', |
204
|
|
|
|
|
|
|
'splice', |
205
|
|
|
|
|
|
|
'split', |
206
|
|
|
|
|
|
|
'sprintf', |
207
|
|
|
|
|
|
|
'sqrt', |
208
|
|
|
|
|
|
|
'srand', |
209
|
|
|
|
|
|
|
'stat', |
210
|
|
|
|
|
|
|
'study', |
211
|
|
|
|
|
|
|
'sub', |
212
|
|
|
|
|
|
|
'substr', |
213
|
|
|
|
|
|
|
'symlink', |
214
|
|
|
|
|
|
|
'syscall', |
215
|
|
|
|
|
|
|
'sysread', |
216
|
|
|
|
|
|
|
'sysseek', |
217
|
|
|
|
|
|
|
'system', |
218
|
|
|
|
|
|
|
'syswrite', |
219
|
|
|
|
|
|
|
'tell', |
220
|
|
|
|
|
|
|
'telldir', |
221
|
|
|
|
|
|
|
'tie', |
222
|
|
|
|
|
|
|
'time', |
223
|
|
|
|
|
|
|
'times', |
224
|
|
|
|
|
|
|
'truncate', |
225
|
|
|
|
|
|
|
'uc', |
226
|
|
|
|
|
|
|
'ucfirst', |
227
|
|
|
|
|
|
|
'umask', |
228
|
|
|
|
|
|
|
'undef', |
229
|
|
|
|
|
|
|
'unlink', |
230
|
|
|
|
|
|
|
'unpack', |
231
|
|
|
|
|
|
|
'unshift', |
232
|
|
|
|
|
|
|
'untie', |
233
|
|
|
|
|
|
|
'utime', |
234
|
|
|
|
|
|
|
'values', |
235
|
|
|
|
|
|
|
'vec', |
236
|
|
|
|
|
|
|
'wait', |
237
|
|
|
|
|
|
|
'waitpid', |
238
|
|
|
|
|
|
|
'wantarray', |
239
|
|
|
|
|
|
|
'warn', |
240
|
|
|
|
|
|
|
'write', |
241
|
|
|
|
|
|
|
); |
242
|
9
|
|
|
|
|
35
|
$self->listAdd('keywords', |
243
|
|
|
|
|
|
|
'BEGIN', |
244
|
|
|
|
|
|
|
'END', |
245
|
|
|
|
|
|
|
'__DATA__', |
246
|
|
|
|
|
|
|
'__END__', |
247
|
|
|
|
|
|
|
'__FILE__', |
248
|
|
|
|
|
|
|
'__LINE__', |
249
|
|
|
|
|
|
|
'__PACKAGE__', |
250
|
|
|
|
|
|
|
'break', |
251
|
|
|
|
|
|
|
'continue', |
252
|
|
|
|
|
|
|
'do', |
253
|
|
|
|
|
|
|
'each', |
254
|
|
|
|
|
|
|
'else', |
255
|
|
|
|
|
|
|
'elsif', |
256
|
|
|
|
|
|
|
'for', |
257
|
|
|
|
|
|
|
'foreach', |
258
|
|
|
|
|
|
|
'if', |
259
|
|
|
|
|
|
|
'last', |
260
|
|
|
|
|
|
|
'local', |
261
|
|
|
|
|
|
|
'my', |
262
|
|
|
|
|
|
|
'next', |
263
|
|
|
|
|
|
|
'no', |
264
|
|
|
|
|
|
|
'our', |
265
|
|
|
|
|
|
|
'package', |
266
|
|
|
|
|
|
|
'require', |
267
|
|
|
|
|
|
|
'require', |
268
|
|
|
|
|
|
|
'return', |
269
|
|
|
|
|
|
|
'sub', |
270
|
|
|
|
|
|
|
'unless', |
271
|
|
|
|
|
|
|
'until', |
272
|
|
|
|
|
|
|
'use', |
273
|
|
|
|
|
|
|
'while', |
274
|
|
|
|
|
|
|
); |
275
|
9
|
|
|
|
|
54
|
$self->listAdd('operators', |
276
|
|
|
|
|
|
|
'!=', |
277
|
|
|
|
|
|
|
'%', |
278
|
|
|
|
|
|
|
'&', |
279
|
|
|
|
|
|
|
'&&', |
280
|
|
|
|
|
|
|
'&&=', |
281
|
|
|
|
|
|
|
'&=', |
282
|
|
|
|
|
|
|
'*', |
283
|
|
|
|
|
|
|
'**=', |
284
|
|
|
|
|
|
|
'*=', |
285
|
|
|
|
|
|
|
'+', |
286
|
|
|
|
|
|
|
'+=', |
287
|
|
|
|
|
|
|
',', |
288
|
|
|
|
|
|
|
'-', |
289
|
|
|
|
|
|
|
'-=', |
290
|
|
|
|
|
|
|
'->', |
291
|
|
|
|
|
|
|
'.', |
292
|
|
|
|
|
|
|
'/=', |
293
|
|
|
|
|
|
|
'::', |
294
|
|
|
|
|
|
|
';', |
295
|
|
|
|
|
|
|
'<', |
296
|
|
|
|
|
|
|
'<<', |
297
|
|
|
|
|
|
|
'=', |
298
|
|
|
|
|
|
|
'=>', |
299
|
|
|
|
|
|
|
'>', |
300
|
|
|
|
|
|
|
'>>', |
301
|
|
|
|
|
|
|
'?=', |
302
|
|
|
|
|
|
|
'\\\\', |
303
|
|
|
|
|
|
|
'^', |
304
|
|
|
|
|
|
|
'and', |
305
|
|
|
|
|
|
|
'eq', |
306
|
|
|
|
|
|
|
'ne', |
307
|
|
|
|
|
|
|
'not', |
308
|
|
|
|
|
|
|
'or', |
309
|
|
|
|
|
|
|
'|', |
310
|
|
|
|
|
|
|
'|=', |
311
|
|
|
|
|
|
|
'||', |
312
|
|
|
|
|
|
|
'||=', |
313
|
|
|
|
|
|
|
'~=', |
314
|
|
|
|
|
|
|
); |
315
|
9
|
|
|
|
|
36
|
$self->listAdd('pragmas', |
316
|
|
|
|
|
|
|
'bytes', |
317
|
|
|
|
|
|
|
'constant', |
318
|
|
|
|
|
|
|
'diagnostics', |
319
|
|
|
|
|
|
|
'english', |
320
|
|
|
|
|
|
|
'filetest', |
321
|
|
|
|
|
|
|
'integer', |
322
|
|
|
|
|
|
|
'less', |
323
|
|
|
|
|
|
|
'locale', |
324
|
|
|
|
|
|
|
'open', |
325
|
|
|
|
|
|
|
'sigtrap', |
326
|
|
|
|
|
|
|
'strict', |
327
|
|
|
|
|
|
|
'subs', |
328
|
|
|
|
|
|
|
'utf8', |
329
|
|
|
|
|
|
|
'vars', |
330
|
|
|
|
|
|
|
'warnings', |
331
|
|
|
|
|
|
|
); |
332
|
9
|
|
|
|
|
1017
|
$self->contextdata({ |
333
|
|
|
|
|
|
|
'Backticked' => { |
334
|
|
|
|
|
|
|
callback => \&parseBackticked, |
335
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
336
|
|
|
|
|
|
|
}, |
337
|
|
|
|
|
|
|
'comment' => { |
338
|
|
|
|
|
|
|
callback => \&parsecomment, |
339
|
|
|
|
|
|
|
attribute => 'Comment', |
340
|
|
|
|
|
|
|
lineending => '#pop', |
341
|
|
|
|
|
|
|
}, |
342
|
|
|
|
|
|
|
'data_handle' => { |
343
|
|
|
|
|
|
|
callback => \&parsedata_handle, |
344
|
|
|
|
|
|
|
attribute => 'Data', |
345
|
|
|
|
|
|
|
}, |
346
|
|
|
|
|
|
|
'end_handle' => { |
347
|
|
|
|
|
|
|
callback => \&parseend_handle, |
348
|
|
|
|
|
|
|
attribute => 'Nothing', |
349
|
|
|
|
|
|
|
}, |
350
|
|
|
|
|
|
|
'find_here_document' => { |
351
|
|
|
|
|
|
|
callback => \&parsefind_here_document, |
352
|
|
|
|
|
|
|
attribute => 'Normal Text', |
353
|
|
|
|
|
|
|
lineending => '#pop', |
354
|
|
|
|
|
|
|
}, |
355
|
|
|
|
|
|
|
'find_pattern' => { |
356
|
|
|
|
|
|
|
callback => \&parsefind_pattern, |
357
|
|
|
|
|
|
|
attribute => 'Pattern', |
358
|
|
|
|
|
|
|
}, |
359
|
|
|
|
|
|
|
'find_qqx' => { |
360
|
|
|
|
|
|
|
callback => \&parsefind_qqx, |
361
|
|
|
|
|
|
|
attribute => 'Normal Text', |
362
|
|
|
|
|
|
|
}, |
363
|
|
|
|
|
|
|
'find_quoted' => { |
364
|
|
|
|
|
|
|
callback => \&parsefind_quoted, |
365
|
|
|
|
|
|
|
attribute => 'Normal Text', |
366
|
|
|
|
|
|
|
}, |
367
|
|
|
|
|
|
|
'find_qw' => { |
368
|
|
|
|
|
|
|
callback => \&parsefind_qw, |
369
|
|
|
|
|
|
|
attribute => 'Normal Text', |
370
|
|
|
|
|
|
|
}, |
371
|
|
|
|
|
|
|
'find_subst' => { |
372
|
|
|
|
|
|
|
callback => \&parsefind_subst, |
373
|
|
|
|
|
|
|
attribute => 'Normal Text', |
374
|
|
|
|
|
|
|
}, |
375
|
|
|
|
|
|
|
'find_variable' => { |
376
|
|
|
|
|
|
|
callback => \&parsefind_variable, |
377
|
|
|
|
|
|
|
attribute => 'Data Type', |
378
|
|
|
|
|
|
|
lineending => '#pop', |
379
|
|
|
|
|
|
|
fallthrough => '#pop', |
380
|
|
|
|
|
|
|
}, |
381
|
|
|
|
|
|
|
'find_variable_unsafe' => { |
382
|
|
|
|
|
|
|
callback => \&parsefind_variable_unsafe, |
383
|
|
|
|
|
|
|
attribute => 'Data Type', |
384
|
|
|
|
|
|
|
lineending => '#pop', |
385
|
|
|
|
|
|
|
fallthrough => '#pop', |
386
|
|
|
|
|
|
|
}, |
387
|
|
|
|
|
|
|
'here_document' => { |
388
|
|
|
|
|
|
|
callback => \&parsehere_document, |
389
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
390
|
|
|
|
|
|
|
dynamic => 1, |
391
|
|
|
|
|
|
|
}, |
392
|
|
|
|
|
|
|
'here_document_dumb' => { |
393
|
|
|
|
|
|
|
callback => \&parsehere_document_dumb, |
394
|
|
|
|
|
|
|
attribute => 'Normal Text', |
395
|
|
|
|
|
|
|
dynamic => 1, |
396
|
|
|
|
|
|
|
}, |
397
|
|
|
|
|
|
|
'ip_string' => { |
398
|
|
|
|
|
|
|
callback => \&parseip_string, |
399
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
400
|
|
|
|
|
|
|
}, |
401
|
|
|
|
|
|
|
'ip_string_2' => { |
402
|
|
|
|
|
|
|
callback => \&parseip_string_2, |
403
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
404
|
|
|
|
|
|
|
}, |
405
|
|
|
|
|
|
|
'ip_string_3' => { |
406
|
|
|
|
|
|
|
callback => \&parseip_string_3, |
407
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
408
|
|
|
|
|
|
|
}, |
409
|
|
|
|
|
|
|
'ip_string_4' => { |
410
|
|
|
|
|
|
|
callback => \&parseip_string_4, |
411
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
412
|
|
|
|
|
|
|
}, |
413
|
|
|
|
|
|
|
'ip_string_5' => { |
414
|
|
|
|
|
|
|
callback => \&parseip_string_5, |
415
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
416
|
|
|
|
|
|
|
}, |
417
|
|
|
|
|
|
|
'ip_string_6' => { |
418
|
|
|
|
|
|
|
callback => \&parseip_string_6, |
419
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
420
|
|
|
|
|
|
|
dynamic => 1, |
421
|
|
|
|
|
|
|
}, |
422
|
|
|
|
|
|
|
'ipstring_internal' => { |
423
|
|
|
|
|
|
|
callback => \&parseipstring_internal, |
424
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
425
|
|
|
|
|
|
|
}, |
426
|
|
|
|
|
|
|
'normal' => { |
427
|
|
|
|
|
|
|
callback => \&parsenormal, |
428
|
|
|
|
|
|
|
attribute => 'Normal Text', |
429
|
|
|
|
|
|
|
}, |
430
|
|
|
|
|
|
|
'package_qualified_blank' => { |
431
|
|
|
|
|
|
|
callback => \&parsepackage_qualified_blank, |
432
|
|
|
|
|
|
|
attribute => 'Normal Text', |
433
|
|
|
|
|
|
|
}, |
434
|
|
|
|
|
|
|
'pat_char_class' => { |
435
|
|
|
|
|
|
|
callback => \&parsepat_char_class, |
436
|
|
|
|
|
|
|
attribute => 'Pattern Character Class', |
437
|
|
|
|
|
|
|
}, |
438
|
|
|
|
|
|
|
'pat_ext' => { |
439
|
|
|
|
|
|
|
callback => \&parsepat_ext, |
440
|
|
|
|
|
|
|
attribute => 'Pattern Internal Operator', |
441
|
|
|
|
|
|
|
}, |
442
|
|
|
|
|
|
|
'pattern' => { |
443
|
|
|
|
|
|
|
callback => \&parsepattern, |
444
|
|
|
|
|
|
|
attribute => 'Pattern', |
445
|
|
|
|
|
|
|
dynamic => 1, |
446
|
|
|
|
|
|
|
}, |
447
|
|
|
|
|
|
|
'pattern_brace' => { |
448
|
|
|
|
|
|
|
callback => \&parsepattern_brace, |
449
|
|
|
|
|
|
|
attribute => 'Pattern', |
450
|
|
|
|
|
|
|
}, |
451
|
|
|
|
|
|
|
'pattern_bracket' => { |
452
|
|
|
|
|
|
|
callback => \&parsepattern_bracket, |
453
|
|
|
|
|
|
|
attribute => 'Pattern', |
454
|
|
|
|
|
|
|
}, |
455
|
|
|
|
|
|
|
'pattern_paren' => { |
456
|
|
|
|
|
|
|
callback => \&parsepattern_paren, |
457
|
|
|
|
|
|
|
attribute => 'Pattern', |
458
|
|
|
|
|
|
|
}, |
459
|
|
|
|
|
|
|
'pattern_slash' => { |
460
|
|
|
|
|
|
|
callback => \&parsepattern_slash, |
461
|
|
|
|
|
|
|
attribute => 'Pattern', |
462
|
|
|
|
|
|
|
}, |
463
|
|
|
|
|
|
|
'pattern_sq' => { |
464
|
|
|
|
|
|
|
callback => \&parsepattern_sq, |
465
|
|
|
|
|
|
|
attribute => 'Pattern', |
466
|
|
|
|
|
|
|
}, |
467
|
|
|
|
|
|
|
'pod' => { |
468
|
|
|
|
|
|
|
callback => \&parsepod, |
469
|
|
|
|
|
|
|
attribute => 'Pod', |
470
|
|
|
|
|
|
|
}, |
471
|
|
|
|
|
|
|
'quote_word' => { |
472
|
|
|
|
|
|
|
callback => \&parsequote_word, |
473
|
|
|
|
|
|
|
attribute => 'Normal Text', |
474
|
|
|
|
|
|
|
dynamic => 1, |
475
|
|
|
|
|
|
|
}, |
476
|
|
|
|
|
|
|
'quote_word_brace' => { |
477
|
|
|
|
|
|
|
callback => \&parsequote_word_brace, |
478
|
|
|
|
|
|
|
attribute => 'Normal Text', |
479
|
|
|
|
|
|
|
}, |
480
|
|
|
|
|
|
|
'quote_word_bracket' => { |
481
|
|
|
|
|
|
|
callback => \&parsequote_word_bracket, |
482
|
|
|
|
|
|
|
attribute => 'Normal Text', |
483
|
|
|
|
|
|
|
}, |
484
|
|
|
|
|
|
|
'quote_word_paren' => { |
485
|
|
|
|
|
|
|
callback => \&parsequote_word_paren, |
486
|
|
|
|
|
|
|
attribute => 'Normal Text', |
487
|
|
|
|
|
|
|
}, |
488
|
|
|
|
|
|
|
'regex_pattern_internal' => { |
489
|
|
|
|
|
|
|
callback => \&parseregex_pattern_internal, |
490
|
|
|
|
|
|
|
attribute => 'Pattern', |
491
|
|
|
|
|
|
|
}, |
492
|
|
|
|
|
|
|
'regex_pattern_internal_ip' => { |
493
|
|
|
|
|
|
|
callback => \&parseregex_pattern_internal_ip, |
494
|
|
|
|
|
|
|
attribute => 'Pattern', |
495
|
|
|
|
|
|
|
}, |
496
|
|
|
|
|
|
|
'regex_pattern_internal_rules_1' => { |
497
|
|
|
|
|
|
|
callback => \&parseregex_pattern_internal_rules_1, |
498
|
|
|
|
|
|
|
}, |
499
|
|
|
|
|
|
|
'regex_pattern_internal_rules_2' => { |
500
|
|
|
|
|
|
|
callback => \&parseregex_pattern_internal_rules_2, |
501
|
|
|
|
|
|
|
}, |
502
|
|
|
|
|
|
|
'slash_safe_escape' => { |
503
|
|
|
|
|
|
|
callback => \&parseslash_safe_escape, |
504
|
|
|
|
|
|
|
attribute => 'Normal Text', |
505
|
|
|
|
|
|
|
lineending => '#pop', |
506
|
|
|
|
|
|
|
fallthrough => '#pop', |
507
|
|
|
|
|
|
|
}, |
508
|
|
|
|
|
|
|
'string' => { |
509
|
|
|
|
|
|
|
callback => \&parsestring, |
510
|
|
|
|
|
|
|
attribute => 'String', |
511
|
|
|
|
|
|
|
}, |
512
|
|
|
|
|
|
|
'string_2' => { |
513
|
|
|
|
|
|
|
callback => \&parsestring_2, |
514
|
|
|
|
|
|
|
attribute => 'String', |
515
|
|
|
|
|
|
|
}, |
516
|
|
|
|
|
|
|
'string_3' => { |
517
|
|
|
|
|
|
|
callback => \&parsestring_3, |
518
|
|
|
|
|
|
|
attribute => 'String', |
519
|
|
|
|
|
|
|
}, |
520
|
|
|
|
|
|
|
'string_4' => { |
521
|
|
|
|
|
|
|
callback => \&parsestring_4, |
522
|
|
|
|
|
|
|
attribute => 'String', |
523
|
|
|
|
|
|
|
}, |
524
|
|
|
|
|
|
|
'string_5' => { |
525
|
|
|
|
|
|
|
callback => \&parsestring_5, |
526
|
|
|
|
|
|
|
attribute => 'String', |
527
|
|
|
|
|
|
|
}, |
528
|
|
|
|
|
|
|
'string_6' => { |
529
|
|
|
|
|
|
|
callback => \&parsestring_6, |
530
|
|
|
|
|
|
|
attribute => 'String', |
531
|
|
|
|
|
|
|
dynamic => 1, |
532
|
|
|
|
|
|
|
}, |
533
|
|
|
|
|
|
|
'sub_arg_definition' => { |
534
|
|
|
|
|
|
|
callback => \&parsesub_arg_definition, |
535
|
|
|
|
|
|
|
attribute => 'Normal Text', |
536
|
|
|
|
|
|
|
fallthrough => '#pop#pop', |
537
|
|
|
|
|
|
|
}, |
538
|
|
|
|
|
|
|
'sub_name_def' => { |
539
|
|
|
|
|
|
|
callback => \&parsesub_name_def, |
540
|
|
|
|
|
|
|
attribute => 'Normal Text', |
541
|
|
|
|
|
|
|
lineending => '#pop', |
542
|
|
|
|
|
|
|
fallthrough => '#pop', |
543
|
|
|
|
|
|
|
}, |
544
|
|
|
|
|
|
|
'subst_bracket_pattern' => { |
545
|
|
|
|
|
|
|
callback => \&parsesubst_bracket_pattern, |
546
|
|
|
|
|
|
|
attribute => 'Pattern', |
547
|
|
|
|
|
|
|
}, |
548
|
|
|
|
|
|
|
'subst_bracket_replace' => { |
549
|
|
|
|
|
|
|
callback => \&parsesubst_bracket_replace, |
550
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
551
|
|
|
|
|
|
|
}, |
552
|
|
|
|
|
|
|
'subst_curlybrace_middle' => { |
553
|
|
|
|
|
|
|
callback => \&parsesubst_curlybrace_middle, |
554
|
|
|
|
|
|
|
attribute => 'Normal Text', |
555
|
|
|
|
|
|
|
}, |
556
|
|
|
|
|
|
|
'subst_curlybrace_pattern' => { |
557
|
|
|
|
|
|
|
callback => \&parsesubst_curlybrace_pattern, |
558
|
|
|
|
|
|
|
attribute => 'Pattern', |
559
|
|
|
|
|
|
|
}, |
560
|
|
|
|
|
|
|
'subst_curlybrace_replace' => { |
561
|
|
|
|
|
|
|
callback => \&parsesubst_curlybrace_replace, |
562
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
563
|
|
|
|
|
|
|
}, |
564
|
|
|
|
|
|
|
'subst_curlybrace_replace_recursive' => { |
565
|
|
|
|
|
|
|
callback => \&parsesubst_curlybrace_replace_recursive, |
566
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
567
|
|
|
|
|
|
|
}, |
568
|
|
|
|
|
|
|
'subst_paren_pattern' => { |
569
|
|
|
|
|
|
|
callback => \&parsesubst_paren_pattern, |
570
|
|
|
|
|
|
|
attribute => 'Pattern', |
571
|
|
|
|
|
|
|
}, |
572
|
|
|
|
|
|
|
'subst_paren_replace' => { |
573
|
|
|
|
|
|
|
callback => \&parsesubst_paren_replace, |
574
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
575
|
|
|
|
|
|
|
}, |
576
|
|
|
|
|
|
|
'subst_slash_pattern' => { |
577
|
|
|
|
|
|
|
callback => \&parsesubst_slash_pattern, |
578
|
|
|
|
|
|
|
attribute => 'Pattern', |
579
|
|
|
|
|
|
|
dynamic => 1, |
580
|
|
|
|
|
|
|
}, |
581
|
|
|
|
|
|
|
'subst_slash_replace' => { |
582
|
|
|
|
|
|
|
callback => \&parsesubst_slash_replace, |
583
|
|
|
|
|
|
|
attribute => 'String (interpolated)', |
584
|
|
|
|
|
|
|
dynamic => 1, |
585
|
|
|
|
|
|
|
}, |
586
|
|
|
|
|
|
|
'subst_sq_pattern' => { |
587
|
|
|
|
|
|
|
callback => \&parsesubst_sq_pattern, |
588
|
|
|
|
|
|
|
attribute => 'Pattern', |
589
|
|
|
|
|
|
|
}, |
590
|
|
|
|
|
|
|
'subst_sq_replace' => { |
591
|
|
|
|
|
|
|
callback => \&parsesubst_sq_replace, |
592
|
|
|
|
|
|
|
attribute => 'String', |
593
|
|
|
|
|
|
|
}, |
594
|
|
|
|
|
|
|
'tr' => { |
595
|
|
|
|
|
|
|
callback => \&parsetr, |
596
|
|
|
|
|
|
|
attribute => 'Pattern', |
597
|
|
|
|
|
|
|
lineending => '#pop', |
598
|
|
|
|
|
|
|
fallthrough => '#pop', |
599
|
|
|
|
|
|
|
}, |
600
|
|
|
|
|
|
|
'var_detect' => { |
601
|
|
|
|
|
|
|
callback => \&parsevar_detect, |
602
|
|
|
|
|
|
|
attribute => 'Data Type', |
603
|
|
|
|
|
|
|
lineending => '#pop#pop', |
604
|
|
|
|
|
|
|
fallthrough => '#pop#pop', |
605
|
|
|
|
|
|
|
}, |
606
|
|
|
|
|
|
|
'var_detect_rules' => { |
607
|
|
|
|
|
|
|
callback => \&parsevar_detect_rules, |
608
|
|
|
|
|
|
|
attribute => 'Data Type', |
609
|
|
|
|
|
|
|
lineending => '#pop#pop', |
610
|
|
|
|
|
|
|
}, |
611
|
|
|
|
|
|
|
'var_detect_unsafe' => { |
612
|
|
|
|
|
|
|
callback => \&parsevar_detect_unsafe, |
613
|
|
|
|
|
|
|
attribute => 'Data Type', |
614
|
|
|
|
|
|
|
lineending => '#pop#pop', |
615
|
|
|
|
|
|
|
fallthrough => '#pop#pop', |
616
|
|
|
|
|
|
|
}, |
617
|
|
|
|
|
|
|
}); |
618
|
9
|
|
|
|
|
63
|
$self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
619
|
9
|
|
|
|
|
36
|
$self->basecontext('normal'); |
620
|
9
|
|
|
|
|
40
|
$self->keywordscase(0); |
621
|
9
|
|
|
|
|
26
|
$self->initialize; |
622
|
9
|
|
|
|
|
18
|
bless ($self, $class); |
623
|
9
|
|
|
|
|
68
|
return $self; |
624
|
|
|
|
|
|
|
} |
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
sub language { |
627
|
0
|
|
|
0
|
0
|
0
|
return 'Perl'; |
628
|
|
|
|
|
|
|
} |
629
|
|
|
|
|
|
|
|
630
|
|
|
|
|
|
|
sub parseBackticked { |
631
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
632
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
633
|
|
|
|
|
|
|
# type => 'IncludeRules' |
634
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
635
|
0
|
|
|
|
|
0
|
return 1 |
636
|
|
|
|
|
|
|
} |
637
|
|
|
|
|
|
|
# attribute => 'Operator' |
638
|
|
|
|
|
|
|
# char => '`' |
639
|
|
|
|
|
|
|
# context => '#pop' |
640
|
|
|
|
|
|
|
# type => 'DetectChar' |
641
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Operator')) { |
642
|
0
|
|
|
|
|
0
|
return 1 |
643
|
|
|
|
|
|
|
} |
644
|
0
|
|
|
|
|
0
|
return 0; |
645
|
|
|
|
|
|
|
}; |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
sub parsecomment { |
648
|
1831
|
|
|
1831
|
0
|
2669
|
my ($self, $text) = @_; |
649
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
650
|
1831
|
100
|
|
|
|
3489
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
651
|
83
|
|
|
|
|
168
|
return 1 |
652
|
|
|
|
|
|
|
} |
653
|
|
|
|
|
|
|
# context => '##Alerts' |
654
|
|
|
|
|
|
|
# type => 'IncludeRules' |
655
|
1748
|
100
|
|
|
|
3253
|
if ($self->includePlugin('Alerts', $text)) { |
656
|
2
|
|
|
|
|
5
|
return 1 |
657
|
|
|
|
|
|
|
} |
658
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
659
|
1746
|
100
|
|
|
|
3730
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
660
|
488
|
|
|
|
|
906
|
return 1 |
661
|
|
|
|
|
|
|
} |
662
|
1258
|
|
|
|
|
1976
|
return 0; |
663
|
|
|
|
|
|
|
}; |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
sub parsedata_handle { |
666
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
667
|
|
|
|
|
|
|
# String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s+.*' |
668
|
|
|
|
|
|
|
# attribute => 'Pod' |
669
|
|
|
|
|
|
|
# beginRegion => 'POD' |
670
|
|
|
|
|
|
|
# column => '0' |
671
|
|
|
|
|
|
|
# context => 'pod' |
672
|
|
|
|
|
|
|
# type => 'RegExpr' |
673
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s+.*', 0, 0, 0, 0, 0, 'pod', 'Pod')) { |
674
|
0
|
|
|
|
|
0
|
return 1 |
675
|
|
|
|
|
|
|
} |
676
|
|
|
|
|
|
|
# String => '__END__' |
677
|
|
|
|
|
|
|
# attribute => 'Keyword' |
678
|
|
|
|
|
|
|
# context => 'normal' |
679
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
680
|
|
|
|
|
|
|
# type => 'StringDetect' |
681
|
0
|
0
|
|
|
|
0
|
if ($self->testStringDetect($text, '__END__', 0, 0, 0, undef, 1, 'normal', 'Keyword')) { |
682
|
0
|
|
|
|
|
0
|
return 1 |
683
|
|
|
|
|
|
|
} |
684
|
0
|
|
|
|
|
0
|
return 0; |
685
|
|
|
|
|
|
|
}; |
686
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
sub parseend_handle { |
688
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
689
|
|
|
|
|
|
|
# String => '^\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*' |
690
|
|
|
|
|
|
|
# attribute => 'Pod' |
691
|
|
|
|
|
|
|
# context => 'pod' |
692
|
|
|
|
|
|
|
# type => 'RegExpr' |
693
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '^\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s*.*', 0, 0, 0, undef, 0, 'pod', 'Pod')) { |
694
|
0
|
|
|
|
|
0
|
return 1 |
695
|
|
|
|
|
|
|
} |
696
|
|
|
|
|
|
|
# String => '__DATA__' |
697
|
|
|
|
|
|
|
# attribute => 'Keyword' |
698
|
|
|
|
|
|
|
# context => 'data_handle' |
699
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
700
|
|
|
|
|
|
|
# type => 'StringDetect' |
701
|
0
|
0
|
|
|
|
0
|
if ($self->testStringDetect($text, '__DATA__', 0, 0, 0, undef, 1, 'data_handle', 'Keyword')) { |
702
|
0
|
|
|
|
|
0
|
return 1 |
703
|
|
|
|
|
|
|
} |
704
|
0
|
|
|
|
|
0
|
return 0; |
705
|
|
|
|
|
|
|
}; |
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
sub parsefind_here_document { |
708
|
3
|
|
|
3
|
0
|
9
|
my ($self, $text) = @_; |
709
|
|
|
|
|
|
|
# String => '(\w+)\s*;?' |
710
|
|
|
|
|
|
|
# attribute => 'Keyword' |
711
|
|
|
|
|
|
|
# context => 'here_document' |
712
|
|
|
|
|
|
|
# type => 'RegExpr' |
713
|
3
|
100
|
|
|
|
12
|
if ($self->testRegExpr($text, '(\\w+)\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) { |
714
|
2
|
|
|
|
|
8
|
return 1 |
715
|
|
|
|
|
|
|
} |
716
|
|
|
|
|
|
|
# String => '\s*"([^"]+)"\s*;?' |
717
|
|
|
|
|
|
|
# attribute => 'Keyword' |
718
|
|
|
|
|
|
|
# context => 'here_document' |
719
|
|
|
|
|
|
|
# type => 'RegExpr' |
720
|
1
|
50
|
|
|
|
4
|
if ($self->testRegExpr($text, '\\s*"([^"]+)"\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) { |
721
|
0
|
|
|
|
|
0
|
return 1 |
722
|
|
|
|
|
|
|
} |
723
|
|
|
|
|
|
|
# String => '\s*`([^`]+)`\s*;?' |
724
|
|
|
|
|
|
|
# attribute => 'Keyword' |
725
|
|
|
|
|
|
|
# context => 'here_document' |
726
|
|
|
|
|
|
|
# type => 'RegExpr' |
727
|
1
|
50
|
|
|
|
4
|
if ($self->testRegExpr($text, '\\s*`([^`]+)`\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) { |
728
|
0
|
|
|
|
|
0
|
return 1 |
729
|
|
|
|
|
|
|
} |
730
|
|
|
|
|
|
|
# String => '\s*'([^']+)'\s*;?' |
731
|
|
|
|
|
|
|
# attribute => 'Keyword' |
732
|
|
|
|
|
|
|
# context => 'here_document_dumb' |
733
|
|
|
|
|
|
|
# type => 'RegExpr' |
734
|
1
|
50
|
|
|
|
3
|
if ($self->testRegExpr($text, '\\s*\'([^\']+)\'\\s*;?', 0, 0, 0, undef, 0, 'here_document_dumb', 'Keyword')) { |
735
|
1
|
|
|
|
|
2
|
return 1 |
736
|
|
|
|
|
|
|
} |
737
|
0
|
|
|
|
|
0
|
return 0; |
738
|
|
|
|
|
|
|
}; |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
sub parsefind_pattern { |
741
|
3
|
|
|
3
|
0
|
7
|
my ($self, $text) = @_; |
742
|
|
|
|
|
|
|
# String => '\s+#.*' |
743
|
|
|
|
|
|
|
# attribute => 'Comment' |
744
|
|
|
|
|
|
|
# context => '#stay' |
745
|
|
|
|
|
|
|
# type => 'RegExpr' |
746
|
3
|
50
|
|
|
|
15
|
if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
747
|
0
|
|
|
|
|
0
|
return 1 |
748
|
|
|
|
|
|
|
} |
749
|
|
|
|
|
|
|
# attribute => 'Operator' |
750
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
751
|
|
|
|
|
|
|
# char => '{' |
752
|
|
|
|
|
|
|
# context => 'pattern_brace' |
753
|
|
|
|
|
|
|
# type => 'DetectChar' |
754
|
3
|
50
|
|
|
|
13
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'pattern_brace', 'Operator')) { |
755
|
0
|
|
|
|
|
0
|
return 1 |
756
|
|
|
|
|
|
|
} |
757
|
|
|
|
|
|
|
# attribute => 'Operator' |
758
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
759
|
|
|
|
|
|
|
# char => '(' |
760
|
|
|
|
|
|
|
# context => 'pattern_paren' |
761
|
|
|
|
|
|
|
# type => 'DetectChar' |
762
|
3
|
50
|
|
|
|
11
|
if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'pattern_paren', 'Operator')) { |
763
|
0
|
|
|
|
|
0
|
return 1 |
764
|
|
|
|
|
|
|
} |
765
|
|
|
|
|
|
|
# attribute => 'Operator' |
766
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
767
|
|
|
|
|
|
|
# char => '[' |
768
|
|
|
|
|
|
|
# context => 'pattern_bracket' |
769
|
|
|
|
|
|
|
# type => 'DetectChar' |
770
|
3
|
50
|
|
|
|
11
|
if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'pattern_bracket', 'Operator')) { |
771
|
0
|
|
|
|
|
0
|
return 1 |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
# attribute => 'Operator' |
774
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
775
|
|
|
|
|
|
|
# char => ''' |
776
|
|
|
|
|
|
|
# context => 'pattern_sq' |
777
|
|
|
|
|
|
|
# type => 'DetectChar' |
778
|
3
|
50
|
|
|
|
13
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'pattern_sq', 'Operator')) { |
779
|
0
|
|
|
|
|
0
|
return 1 |
780
|
|
|
|
|
|
|
} |
781
|
|
|
|
|
|
|
# String => '([^\w\s])' |
782
|
|
|
|
|
|
|
# attribute => 'Operator' |
783
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
784
|
|
|
|
|
|
|
# context => 'pattern' |
785
|
|
|
|
|
|
|
# type => 'RegExpr' |
786
|
3
|
50
|
|
|
|
13
|
if ($self->testRegExpr($text, '([^\\w\\s])', 0, 0, 0, undef, 0, 'pattern', 'Operator')) { |
787
|
3
|
|
|
|
|
8
|
return 1 |
788
|
|
|
|
|
|
|
} |
789
|
0
|
|
|
|
|
0
|
return 0; |
790
|
|
|
|
|
|
|
}; |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
sub parsefind_qqx { |
793
|
2
|
|
|
2
|
0
|
8
|
my ($self, $text) = @_; |
794
|
|
|
|
|
|
|
# attribute => 'Operator' |
795
|
|
|
|
|
|
|
# beginRegion => 'String' |
796
|
|
|
|
|
|
|
# char => '(' |
797
|
|
|
|
|
|
|
# context => 'ip_string_2' |
798
|
|
|
|
|
|
|
# type => 'DetectChar' |
799
|
2
|
50
|
|
|
|
7
|
if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ip_string_2', 'Operator')) { |
800
|
0
|
|
|
|
|
0
|
return 1 |
801
|
|
|
|
|
|
|
} |
802
|
|
|
|
|
|
|
# attribute => 'Operator' |
803
|
|
|
|
|
|
|
# beginRegion => 'String' |
804
|
|
|
|
|
|
|
# char => '{' |
805
|
|
|
|
|
|
|
# context => 'ip_string_3' |
806
|
|
|
|
|
|
|
# type => 'DetectChar' |
807
|
2
|
50
|
|
|
|
7
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'ip_string_3', 'Operator')) { |
808
|
0
|
|
|
|
|
0
|
return 1 |
809
|
|
|
|
|
|
|
} |
810
|
|
|
|
|
|
|
# attribute => 'Operator' |
811
|
|
|
|
|
|
|
# beginRegion => 'String' |
812
|
|
|
|
|
|
|
# char => '[' |
813
|
|
|
|
|
|
|
# context => 'ip_string_4' |
814
|
|
|
|
|
|
|
# type => 'DetectChar' |
815
|
2
|
50
|
|
|
|
8
|
if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'ip_string_4', 'Operator')) { |
816
|
0
|
|
|
|
|
0
|
return 1 |
817
|
|
|
|
|
|
|
} |
818
|
|
|
|
|
|
|
# attribute => 'Operator' |
819
|
|
|
|
|
|
|
# beginRegion => 'String' |
820
|
|
|
|
|
|
|
# char => '<' |
821
|
|
|
|
|
|
|
# context => 'ip_string_5' |
822
|
|
|
|
|
|
|
# type => 'DetectChar' |
823
|
2
|
50
|
|
|
|
16
|
if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'ip_string_5', 'Operator')) { |
824
|
0
|
|
|
|
|
0
|
return 1 |
825
|
|
|
|
|
|
|
} |
826
|
|
|
|
|
|
|
# String => '([^a-zA-Z0-9_\s[\]{}()])' |
827
|
|
|
|
|
|
|
# attribute => 'Operator' |
828
|
|
|
|
|
|
|
# beginRegion => 'String' |
829
|
|
|
|
|
|
|
# context => 'ip_string_6' |
830
|
|
|
|
|
|
|
# type => 'RegExpr' |
831
|
2
|
50
|
|
|
|
9
|
if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'ip_string_6', 'Operator')) { |
832
|
2
|
|
|
|
|
30
|
return 1 |
833
|
|
|
|
|
|
|
} |
834
|
|
|
|
|
|
|
# String => '\s+#.*' |
835
|
|
|
|
|
|
|
# attribute => 'Comment' |
836
|
|
|
|
|
|
|
# context => '#stay' |
837
|
|
|
|
|
|
|
# type => 'RegExpr' |
838
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
839
|
0
|
|
|
|
|
0
|
return 1 |
840
|
|
|
|
|
|
|
} |
841
|
0
|
|
|
|
|
0
|
return 0; |
842
|
|
|
|
|
|
|
}; |
843
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
sub parsefind_quoted { |
845
|
7
|
|
|
7
|
0
|
18
|
my ($self, $text) = @_; |
846
|
|
|
|
|
|
|
# String => 'x\s*(')' |
847
|
|
|
|
|
|
|
# attribute => 'Operator' |
848
|
|
|
|
|
|
|
# beginRegion => 'String' |
849
|
|
|
|
|
|
|
# context => 'string_6' |
850
|
|
|
|
|
|
|
# type => 'RegExpr' |
851
|
7
|
50
|
|
|
|
31
|
if ($self->testRegExpr($text, 'x\\s*(\')', 0, 0, 0, undef, 0, 'string_6', 'Operator')) { |
852
|
0
|
|
|
|
|
0
|
return 1 |
853
|
|
|
|
|
|
|
} |
854
|
|
|
|
|
|
|
# String => 'qx' |
855
|
|
|
|
|
|
|
# attribute => 'Operator' |
856
|
|
|
|
|
|
|
# context => 'find_qqx' |
857
|
|
|
|
|
|
|
# type => 'AnyChar' |
858
|
7
|
100
|
|
|
|
28
|
if ($self->testAnyChar($text, 'qx', 0, 0, undef, 0, 'find_qqx', 'Operator')) { |
859
|
2
|
|
|
|
|
5
|
return 1 |
860
|
|
|
|
|
|
|
} |
861
|
|
|
|
|
|
|
# attribute => 'Operator' |
862
|
|
|
|
|
|
|
# char => 'w' |
863
|
|
|
|
|
|
|
# context => 'find_qw' |
864
|
|
|
|
|
|
|
# type => 'DetectChar' |
865
|
5
|
100
|
|
|
|
21
|
if ($self->testDetectChar($text, 'w', 0, 0, 0, undef, 0, 'find_qw', 'Operator')) { |
866
|
3
|
|
|
|
|
8
|
return 1 |
867
|
|
|
|
|
|
|
} |
868
|
|
|
|
|
|
|
# attribute => 'Operator' |
869
|
|
|
|
|
|
|
# beginRegion => 'String' |
870
|
|
|
|
|
|
|
# char => '(' |
871
|
|
|
|
|
|
|
# context => 'string_2' |
872
|
|
|
|
|
|
|
# type => 'DetectChar' |
873
|
2
|
50
|
|
|
|
10
|
if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'string_2', 'Operator')) { |
874
|
0
|
|
|
|
|
0
|
return 1 |
875
|
|
|
|
|
|
|
} |
876
|
|
|
|
|
|
|
# attribute => 'Operator' |
877
|
|
|
|
|
|
|
# beginRegion => 'String' |
878
|
|
|
|
|
|
|
# char => '{' |
879
|
|
|
|
|
|
|
# context => 'string_3' |
880
|
|
|
|
|
|
|
# type => 'DetectChar' |
881
|
2
|
50
|
|
|
|
9
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'string_3', 'Operator')) { |
882
|
0
|
|
|
|
|
0
|
return 1 |
883
|
|
|
|
|
|
|
} |
884
|
|
|
|
|
|
|
# attribute => 'Operator' |
885
|
|
|
|
|
|
|
# beginRegion => 'String' |
886
|
|
|
|
|
|
|
# char => '[' |
887
|
|
|
|
|
|
|
# context => 'string_4' |
888
|
|
|
|
|
|
|
# type => 'DetectChar' |
889
|
2
|
50
|
|
|
|
9
|
if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'string_4', 'Operator')) { |
890
|
0
|
|
|
|
|
0
|
return 1 |
891
|
|
|
|
|
|
|
} |
892
|
|
|
|
|
|
|
# attribute => 'Operator' |
893
|
|
|
|
|
|
|
# beginRegion => 'String' |
894
|
|
|
|
|
|
|
# char => '<' |
895
|
|
|
|
|
|
|
# context => 'string_5' |
896
|
|
|
|
|
|
|
# type => 'DetectChar' |
897
|
2
|
50
|
|
|
|
9
|
if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'string_5', 'Operator')) { |
898
|
0
|
|
|
|
|
0
|
return 1 |
899
|
|
|
|
|
|
|
} |
900
|
|
|
|
|
|
|
# String => '([^a-zA-Z0-9_\s[\]{}()])' |
901
|
|
|
|
|
|
|
# attribute => 'Operator' |
902
|
|
|
|
|
|
|
# beginRegion => 'String' |
903
|
|
|
|
|
|
|
# context => 'string_6' |
904
|
|
|
|
|
|
|
# type => 'RegExpr' |
905
|
2
|
50
|
|
|
|
8
|
if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'string_6', 'Operator')) { |
906
|
2
|
|
|
|
|
5
|
return 1 |
907
|
|
|
|
|
|
|
} |
908
|
|
|
|
|
|
|
# String => '\s+#.*' |
909
|
|
|
|
|
|
|
# attribute => 'Comment' |
910
|
|
|
|
|
|
|
# context => '#stay' |
911
|
|
|
|
|
|
|
# type => 'RegExpr' |
912
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
913
|
0
|
|
|
|
|
0
|
return 1 |
914
|
|
|
|
|
|
|
} |
915
|
0
|
|
|
|
|
0
|
return 0; |
916
|
|
|
|
|
|
|
}; |
917
|
|
|
|
|
|
|
|
918
|
|
|
|
|
|
|
sub parsefind_qw { |
919
|
3
|
|
|
3
|
0
|
18
|
my ($self, $text) = @_; |
920
|
|
|
|
|
|
|
# attribute => 'Operator' |
921
|
|
|
|
|
|
|
# beginRegion => 'Wordlist' |
922
|
|
|
|
|
|
|
# char => '(' |
923
|
|
|
|
|
|
|
# context => 'quote_word_paren' |
924
|
|
|
|
|
|
|
# type => 'DetectChar' |
925
|
3
|
50
|
|
|
|
13
|
if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'quote_word_paren', 'Operator')) { |
926
|
3
|
|
|
|
|
8
|
return 1 |
927
|
|
|
|
|
|
|
} |
928
|
|
|
|
|
|
|
# attribute => 'Operator' |
929
|
|
|
|
|
|
|
# beginRegion => 'Wordlist' |
930
|
|
|
|
|
|
|
# char => '{' |
931
|
|
|
|
|
|
|
# context => 'quote_word_brace' |
932
|
|
|
|
|
|
|
# type => 'DetectChar' |
933
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'quote_word_brace', 'Operator')) { |
934
|
0
|
|
|
|
|
0
|
return 1 |
935
|
|
|
|
|
|
|
} |
936
|
|
|
|
|
|
|
# attribute => 'Operator' |
937
|
|
|
|
|
|
|
# beginRegion => 'Wordlist' |
938
|
|
|
|
|
|
|
# char => '[' |
939
|
|
|
|
|
|
|
# context => 'quote_word_bracket' |
940
|
|
|
|
|
|
|
# type => 'DetectChar' |
941
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'quote_word_bracket', 'Operator')) { |
942
|
0
|
|
|
|
|
0
|
return 1 |
943
|
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
# String => '([^a-zA-Z0-9_\s[\]{}()])' |
945
|
|
|
|
|
|
|
# attribute => 'Operator' |
946
|
|
|
|
|
|
|
# beginRegion => 'Wordlist' |
947
|
|
|
|
|
|
|
# context => 'quote_word' |
948
|
|
|
|
|
|
|
# type => 'RegExpr' |
949
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'quote_word', 'Operator')) { |
950
|
0
|
|
|
|
|
0
|
return 1 |
951
|
|
|
|
|
|
|
} |
952
|
|
|
|
|
|
|
# String => '\s+#.*' |
953
|
|
|
|
|
|
|
# attribute => 'Comment' |
954
|
|
|
|
|
|
|
# context => '#stay' |
955
|
|
|
|
|
|
|
# type => 'RegExpr' |
956
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
957
|
0
|
|
|
|
|
0
|
return 1 |
958
|
|
|
|
|
|
|
} |
959
|
0
|
|
|
|
|
0
|
return 0; |
960
|
|
|
|
|
|
|
}; |
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
sub parsefind_subst { |
963
|
26
|
|
|
26
|
0
|
74
|
my ($self, $text) = @_; |
964
|
|
|
|
|
|
|
# String => '\s+#.*' |
965
|
|
|
|
|
|
|
# attribute => 'Comment' |
966
|
|
|
|
|
|
|
# context => '#stay' |
967
|
|
|
|
|
|
|
# type => 'RegExpr' |
968
|
26
|
50
|
|
|
|
91
|
if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
969
|
0
|
|
|
|
|
0
|
return 1 |
970
|
|
|
|
|
|
|
} |
971
|
|
|
|
|
|
|
# attribute => 'Operator' |
972
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
973
|
|
|
|
|
|
|
# char => '{' |
974
|
|
|
|
|
|
|
# context => 'subst_curlybrace_pattern' |
975
|
|
|
|
|
|
|
# type => 'DetectChar' |
976
|
26
|
50
|
|
|
|
83
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_pattern', 'Operator')) { |
977
|
0
|
|
|
|
|
0
|
return 1 |
978
|
|
|
|
|
|
|
} |
979
|
|
|
|
|
|
|
# attribute => 'Operator' |
980
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
981
|
|
|
|
|
|
|
# char => '(' |
982
|
|
|
|
|
|
|
# context => 'subst_paren_pattern' |
983
|
|
|
|
|
|
|
# type => 'DetectChar' |
984
|
26
|
50
|
|
|
|
74
|
if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'subst_paren_pattern', 'Operator')) { |
985
|
0
|
|
|
|
|
0
|
return 1 |
986
|
|
|
|
|
|
|
} |
987
|
|
|
|
|
|
|
# attribute => 'Operator' |
988
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
989
|
|
|
|
|
|
|
# char => '[' |
990
|
|
|
|
|
|
|
# context => 'subst_bracket_pattern' |
991
|
|
|
|
|
|
|
# type => 'DetectChar' |
992
|
26
|
50
|
|
|
|
65
|
if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'subst_bracket_pattern', 'Operator')) { |
993
|
0
|
|
|
|
|
0
|
return 1 |
994
|
|
|
|
|
|
|
} |
995
|
|
|
|
|
|
|
# attribute => 'Operator' |
996
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
997
|
|
|
|
|
|
|
# char => ''' |
998
|
|
|
|
|
|
|
# context => 'subst_sq_pattern' |
999
|
|
|
|
|
|
|
# type => 'DetectChar' |
1000
|
26
|
50
|
|
|
|
76
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'subst_sq_pattern', 'Operator')) { |
1001
|
0
|
|
|
|
|
0
|
return 1 |
1002
|
|
|
|
|
|
|
} |
1003
|
|
|
|
|
|
|
# String => '([^\w\s[\]{}()])' |
1004
|
|
|
|
|
|
|
# attribute => 'Operator' |
1005
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
1006
|
|
|
|
|
|
|
# context => 'subst_slash_pattern' |
1007
|
|
|
|
|
|
|
# type => 'RegExpr' |
1008
|
26
|
50
|
|
|
|
65
|
if ($self->testRegExpr($text, '([^\\w\\s[\\]{}()])', 0, 0, 0, undef, 0, 'subst_slash_pattern', 'Operator')) { |
1009
|
26
|
|
|
|
|
56
|
return 1 |
1010
|
|
|
|
|
|
|
} |
1011
|
0
|
|
|
|
|
0
|
return 0; |
1012
|
|
|
|
|
|
|
}; |
1013
|
|
|
|
|
|
|
|
1014
|
|
|
|
|
|
|
sub parsefind_variable { |
1015
|
1087
|
|
|
1087
|
0
|
1883
|
my ($self, $text) = @_; |
1016
|
|
|
|
|
|
|
# String => '\$[0-9]+' |
1017
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1018
|
|
|
|
|
|
|
# context => 'var_detect' |
1019
|
|
|
|
|
|
|
# type => 'RegExpr' |
1020
|
1087
|
100
|
|
|
|
2221
|
if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) { |
1021
|
21
|
|
|
|
|
46
|
return 1 |
1022
|
|
|
|
|
|
|
} |
1023
|
|
|
|
|
|
|
# String => '[@\$](?:[\+\-_]\B|ARGV\b|INC\b)' |
1024
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1025
|
|
|
|
|
|
|
# context => 'var_detect' |
1026
|
|
|
|
|
|
|
# type => 'RegExpr' |
1027
|
1066
|
100
|
|
|
|
2547
|
if ($self->testRegExpr($text, '[@\\$](?:[\\+\\-_]\\B|ARGV\\b|INC\\b)', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) { |
1028
|
2
|
|
|
|
|
6
|
return 1 |
1029
|
|
|
|
|
|
|
} |
1030
|
|
|
|
|
|
|
# String => '[%\$](?:INC\b|ENV\b|SIG\b)' |
1031
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1032
|
|
|
|
|
|
|
# context => 'var_detect' |
1033
|
|
|
|
|
|
|
# type => 'RegExpr' |
1034
|
1064
|
50
|
|
|
|
2727
|
if ($self->testRegExpr($text, '[%\\$](?:INC\\b|ENV\\b|SIG\\b)', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) { |
1035
|
0
|
|
|
|
|
0
|
return 1 |
1036
|
|
|
|
|
|
|
} |
1037
|
|
|
|
|
|
|
# String => '\$\$[\$\w_]' |
1038
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1039
|
|
|
|
|
|
|
# context => 'var_detect' |
1040
|
|
|
|
|
|
|
# type => 'RegExpr' |
1041
|
1064
|
100
|
|
|
|
2502
|
if ($self->testRegExpr($text, '\\$\\$[\\$\\w_]', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { |
1042
|
24
|
|
|
|
|
57
|
return 1 |
1043
|
|
|
|
|
|
|
} |
1044
|
|
|
|
|
|
|
# String => '\$[#_][\w_]' |
1045
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1046
|
|
|
|
|
|
|
# context => 'var_detect' |
1047
|
|
|
|
|
|
|
# type => 'RegExpr' |
1048
|
1040
|
50
|
|
|
|
2578
|
if ($self->testRegExpr($text, '\\$[#_][\\w_]', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { |
1049
|
0
|
|
|
|
|
0
|
return 1 |
1050
|
|
|
|
|
|
|
} |
1051
|
|
|
|
|
|
|
# String => '\$+::' |
1052
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1053
|
|
|
|
|
|
|
# context => 'var_detect' |
1054
|
|
|
|
|
|
|
# type => 'RegExpr' |
1055
|
1040
|
50
|
|
|
|
2434
|
if ($self->testRegExpr($text, '\\$+::', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { |
1056
|
0
|
|
|
|
|
0
|
return 1 |
1057
|
|
|
|
|
|
|
} |
1058
|
|
|
|
|
|
|
# String => '\$[^a-zA-Z0-9\s{][A-Z]?' |
1059
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1060
|
|
|
|
|
|
|
# context => '#stay' |
1061
|
|
|
|
|
|
|
# type => 'RegExpr' |
1062
|
1040
|
100
|
|
|
|
2305
|
if ($self->testRegExpr($text, '\\$[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) { |
1063
|
11
|
|
|
|
|
26
|
return 1 |
1064
|
|
|
|
|
|
|
} |
1065
|
|
|
|
|
|
|
# String => '[\$@%]\{[\w_]+\}' |
1066
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1067
|
|
|
|
|
|
|
# context => 'var_detect' |
1068
|
|
|
|
|
|
|
# type => 'RegExpr' |
1069
|
1029
|
50
|
|
|
|
2400
|
if ($self->testRegExpr($text, '[\\$@%]\\{[\\w_]+\\}', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { |
1070
|
0
|
|
|
|
|
0
|
return 1 |
1071
|
|
|
|
|
|
|
} |
1072
|
|
|
|
|
|
|
# String => '$@%' |
1073
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1074
|
|
|
|
|
|
|
# context => 'var_detect' |
1075
|
|
|
|
|
|
|
# type => 'AnyChar' |
1076
|
1029
|
100
|
|
|
|
2703
|
if ($self->testAnyChar($text, '$@%', 0, 0, undef, 0, 'var_detect', 'Data Type')) { |
1077
|
1015
|
|
|
|
|
2015
|
return 1 |
1078
|
|
|
|
|
|
|
} |
1079
|
|
|
|
|
|
|
# String => '\*[a-zA-Z_]+' |
1080
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1081
|
|
|
|
|
|
|
# context => 'var_detect' |
1082
|
|
|
|
|
|
|
# type => 'RegExpr' |
1083
|
14
|
50
|
|
|
|
38
|
if ($self->testRegExpr($text, '\\*[a-zA-Z_]+', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) { |
1084
|
0
|
|
|
|
|
0
|
return 1 |
1085
|
|
|
|
|
|
|
} |
1086
|
|
|
|
|
|
|
# String => '\*[^a-zA-Z0-9\s{][A-Z]?' |
1087
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1088
|
|
|
|
|
|
|
# context => '#stay' |
1089
|
|
|
|
|
|
|
# type => 'RegExpr' |
1090
|
14
|
50
|
|
|
|
49
|
if ($self->testRegExpr($text, '\\*[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) { |
1091
|
0
|
|
|
|
|
0
|
return 1 |
1092
|
|
|
|
|
|
|
} |
1093
|
|
|
|
|
|
|
# String => '$@%*' |
1094
|
|
|
|
|
|
|
# attribute => 'Operator' |
1095
|
|
|
|
|
|
|
# context => '#pop' |
1096
|
|
|
|
|
|
|
# type => 'AnyChar' |
1097
|
14
|
100
|
|
|
|
45
|
if ($self->testAnyChar($text, '$@%*', 0, 0, undef, 0, '#pop', 'Operator')) { |
1098
|
1
|
|
|
|
|
3
|
return 1 |
1099
|
|
|
|
|
|
|
} |
1100
|
13
|
|
|
|
|
28
|
return 0; |
1101
|
|
|
|
|
|
|
}; |
1102
|
|
|
|
|
|
|
|
1103
|
|
|
|
|
|
|
sub parsefind_variable_unsafe { |
1104
|
30
|
|
|
30
|
0
|
64
|
my ($self, $text) = @_; |
1105
|
|
|
|
|
|
|
# String => '\$[0-9]+' |
1106
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1107
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1108
|
|
|
|
|
|
|
# type => 'RegExpr' |
1109
|
30
|
100
|
|
|
|
79
|
if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) { |
1110
|
2
|
|
|
|
|
6
|
return 1 |
1111
|
|
|
|
|
|
|
} |
1112
|
|
|
|
|
|
|
# String => '[@\$](?:[\+\-_]\B|ARGV\b|INC\b)' |
1113
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1114
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1115
|
|
|
|
|
|
|
# type => 'RegExpr' |
1116
|
28
|
50
|
|
|
|
86
|
if ($self->testRegExpr($text, '[@\\$](?:[\\+\\-_]\\B|ARGV\\b|INC\\b)', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) { |
1117
|
0
|
|
|
|
|
0
|
return 1 |
1118
|
|
|
|
|
|
|
} |
1119
|
|
|
|
|
|
|
# String => '[%\$](?:INC\b|ENV\b|SIG\b)' |
1120
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1121
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1122
|
|
|
|
|
|
|
# type => 'RegExpr' |
1123
|
28
|
50
|
|
|
|
93
|
if ($self->testRegExpr($text, '[%\\$](?:INC\\b|ENV\\b|SIG\\b)', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) { |
1124
|
0
|
|
|
|
|
0
|
return 1 |
1125
|
|
|
|
|
|
|
} |
1126
|
|
|
|
|
|
|
# String => '\$\$[\$\w_]' |
1127
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1128
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1129
|
|
|
|
|
|
|
# type => 'RegExpr' |
1130
|
28
|
50
|
|
|
|
82
|
if ($self->testRegExpr($text, '\\$\\$[\\$\\w_]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { |
1131
|
0
|
|
|
|
|
0
|
return 1 |
1132
|
|
|
|
|
|
|
} |
1133
|
|
|
|
|
|
|
# String => '\$[#_][\w_]' |
1134
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1135
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1136
|
|
|
|
|
|
|
# type => 'RegExpr' |
1137
|
28
|
50
|
|
|
|
90
|
if ($self->testRegExpr($text, '\\$[#_][\\w_]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { |
1138
|
0
|
|
|
|
|
0
|
return 1 |
1139
|
|
|
|
|
|
|
} |
1140
|
|
|
|
|
|
|
# String => '\$+::' |
1141
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1142
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1143
|
|
|
|
|
|
|
# type => 'RegExpr' |
1144
|
28
|
50
|
|
|
|
93
|
if ($self->testRegExpr($text, '\\$+::', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { |
1145
|
0
|
|
|
|
|
0
|
return 1 |
1146
|
|
|
|
|
|
|
} |
1147
|
|
|
|
|
|
|
# String => '\$[^a-zA-Z0-9\s{][A-Z]?' |
1148
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
1149
|
|
|
|
|
|
|
# context => '#stay' |
1150
|
|
|
|
|
|
|
# type => 'RegExpr' |
1151
|
28
|
100
|
|
|
|
82
|
if ($self->testRegExpr($text, '\\$[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) { |
1152
|
1
|
|
|
|
|
11
|
return 1 |
1153
|
|
|
|
|
|
|
} |
1154
|
|
|
|
|
|
|
# String => '[\$@%]\{[\w_]+\}' |
1155
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1156
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1157
|
|
|
|
|
|
|
# type => 'RegExpr' |
1158
|
27
|
50
|
|
|
|
83
|
if ($self->testRegExpr($text, '[\\$@%]\\{[\\w_]+\\}', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { |
1159
|
0
|
|
|
|
|
0
|
return 1 |
1160
|
|
|
|
|
|
|
} |
1161
|
|
|
|
|
|
|
# String => '[\$@%]' |
1162
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1163
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1164
|
|
|
|
|
|
|
# type => 'RegExpr' |
1165
|
27
|
100
|
|
|
|
83
|
if ($self->testRegExpr($text, '[\\$@%]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { |
1166
|
26
|
|
|
|
|
61
|
return 1 |
1167
|
|
|
|
|
|
|
} |
1168
|
|
|
|
|
|
|
# String => '\*\w+' |
1169
|
|
|
|
|
|
|
# attribute => 'Data Type' |
1170
|
|
|
|
|
|
|
# context => 'var_detect_unsafe' |
1171
|
|
|
|
|
|
|
# type => 'RegExpr' |
1172
|
1
|
50
|
|
|
|
14
|
if ($self->testRegExpr($text, '\\*\\w+', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) { |
1173
|
0
|
|
|
|
|
0
|
return 1 |
1174
|
|
|
|
|
|
|
} |
1175
|
|
|
|
|
|
|
# String => '$@%*' |
1176
|
|
|
|
|
|
|
# attribute => 'Operator' |
1177
|
|
|
|
|
|
|
# context => '#pop' |
1178
|
|
|
|
|
|
|
# type => 'AnyChar' |
1179
|
1
|
50
|
|
|
|
4
|
if ($self->testAnyChar($text, '$@%*', 0, 0, undef, 0, '#pop', 'Operator')) { |
1180
|
0
|
|
|
|
|
0
|
return 1 |
1181
|
|
|
|
|
|
|
} |
1182
|
1
|
|
|
|
|
2
|
return 0; |
1183
|
|
|
|
|
|
|
}; |
1184
|
|
|
|
|
|
|
|
1185
|
|
|
|
|
|
|
sub parsehere_document { |
1186
|
34
|
|
|
34
|
0
|
56
|
my ($self, $text) = @_; |
1187
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
1188
|
34
|
50
|
|
|
|
73
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
1189
|
0
|
|
|
|
|
0
|
return 1 |
1190
|
|
|
|
|
|
|
} |
1191
|
|
|
|
|
|
|
# String => '%1' |
1192
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1193
|
|
|
|
|
|
|
# column => '0' |
1194
|
|
|
|
|
|
|
# context => '#pop#pop' |
1195
|
|
|
|
|
|
|
# dynamic => 'true' |
1196
|
|
|
|
|
|
|
# endRegion => 'HereDocument' |
1197
|
|
|
|
|
|
|
# type => 'RegExpr' |
1198
|
34
|
100
|
|
|
|
71
|
if ($self->testRegExpr($text, '%1', 0, 1, 0, 0, 0, '#pop#pop', 'Keyword')) { |
1199
|
2
|
|
|
|
|
5
|
return 1 |
1200
|
|
|
|
|
|
|
} |
1201
|
|
|
|
|
|
|
# String => '\=\s*<<\s*["']?([A-Z0-9_\-]+)["']?' |
1202
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1203
|
|
|
|
|
|
|
# beginRegion => 'HEREDoc' |
1204
|
|
|
|
|
|
|
# context => 'here_document' |
1205
|
|
|
|
|
|
|
# type => 'RegExpr' |
1206
|
32
|
50
|
|
|
|
84
|
if ($self->testRegExpr($text, '\\=\\s*<<\\s*["\']?([A-Z0-9_\\-]+)["\']?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) { |
1207
|
0
|
|
|
|
|
0
|
return 1 |
1208
|
|
|
|
|
|
|
} |
1209
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
1210
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1211
|
32
|
100
|
|
|
|
76
|
if ($self->includeRules('ipstring_internal', $text)) { |
1212
|
16
|
|
|
|
|
29
|
return 1 |
1213
|
|
|
|
|
|
|
} |
1214
|
16
|
|
|
|
|
32
|
return 0; |
1215
|
|
|
|
|
|
|
}; |
1216
|
|
|
|
|
|
|
|
1217
|
|
|
|
|
|
|
sub parsehere_document_dumb { |
1218
|
6
|
|
|
6
|
0
|
10
|
my ($self, $text) = @_; |
1219
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
1220
|
6
|
50
|
|
|
|
13
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
1221
|
0
|
|
|
|
|
0
|
return 1 |
1222
|
|
|
|
|
|
|
} |
1223
|
|
|
|
|
|
|
# String => '%1' |
1224
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1225
|
|
|
|
|
|
|
# column => '0' |
1226
|
|
|
|
|
|
|
# context => '#pop#pop' |
1227
|
|
|
|
|
|
|
# dynamic => 'true' |
1228
|
|
|
|
|
|
|
# endRegion => 'HereDocument' |
1229
|
|
|
|
|
|
|
# type => 'RegExpr' |
1230
|
6
|
100
|
|
|
|
16
|
if ($self->testRegExpr($text, '%1', 0, 1, 0, 0, 0, '#pop#pop', 'Keyword')) { |
1231
|
1
|
|
|
|
|
2
|
return 1 |
1232
|
|
|
|
|
|
|
} |
1233
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
1234
|
5
|
100
|
|
|
|
14
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
1235
|
3
|
|
|
|
|
7
|
return 1 |
1236
|
|
|
|
|
|
|
} |
1237
|
2
|
|
|
|
|
4
|
return 0; |
1238
|
|
|
|
|
|
|
}; |
1239
|
|
|
|
|
|
|
|
1240
|
|
|
|
|
|
|
sub parseip_string { |
1241
|
278
|
|
|
278
|
0
|
427
|
my ($self, $text) = @_; |
1242
|
|
|
|
|
|
|
# attribute => 'Operator' |
1243
|
|
|
|
|
|
|
# char => '"' |
1244
|
|
|
|
|
|
|
# context => '#pop' |
1245
|
|
|
|
|
|
|
# endRegion => 'String' |
1246
|
|
|
|
|
|
|
# type => 'DetectChar' |
1247
|
278
|
100
|
|
|
|
583
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Operator')) { |
1248
|
37
|
|
|
|
|
81
|
return 1 |
1249
|
|
|
|
|
|
|
} |
1250
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
1251
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1252
|
241
|
100
|
|
|
|
549
|
if ($self->includeRules('ipstring_internal', $text)) { |
1253
|
124
|
|
|
|
|
218
|
return 1 |
1254
|
|
|
|
|
|
|
} |
1255
|
117
|
|
|
|
|
219
|
return 0; |
1256
|
|
|
|
|
|
|
}; |
1257
|
|
|
|
|
|
|
|
1258
|
|
|
|
|
|
|
sub parseip_string_2 { |
1259
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1260
|
|
|
|
|
|
|
# attribute => 'String (interpolated)' |
1261
|
|
|
|
|
|
|
# char => '(' |
1262
|
|
|
|
|
|
|
# char1 => ')' |
1263
|
|
|
|
|
|
|
# context => '#stay' |
1264
|
|
|
|
|
|
|
# type => 'RangeDetect' |
1265
|
0
|
0
|
|
|
|
0
|
if ($self->testRangeDetect($text, '(', ')', 0, 0, undef, 0, '#stay', 'String (interpolated)')) { |
1266
|
0
|
|
|
|
|
0
|
return 1 |
1267
|
|
|
|
|
|
|
} |
1268
|
|
|
|
|
|
|
# attribute => 'Operator' |
1269
|
|
|
|
|
|
|
# char => ')' |
1270
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
1271
|
|
|
|
|
|
|
# endRegion => 'String' |
1272
|
|
|
|
|
|
|
# type => 'DetectChar' |
1273
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
1274
|
0
|
|
|
|
|
0
|
return 1 |
1275
|
|
|
|
|
|
|
} |
1276
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
1277
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1278
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
1279
|
0
|
|
|
|
|
0
|
return 1 |
1280
|
|
|
|
|
|
|
} |
1281
|
0
|
|
|
|
|
0
|
return 0; |
1282
|
|
|
|
|
|
|
}; |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
sub parseip_string_3 { |
1285
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1286
|
|
|
|
|
|
|
# attribute => 'String (interpolated)' |
1287
|
|
|
|
|
|
|
# char => '{' |
1288
|
|
|
|
|
|
|
# char1 => '}' |
1289
|
|
|
|
|
|
|
# context => '#stay' |
1290
|
|
|
|
|
|
|
# type => 'RangeDetect' |
1291
|
0
|
0
|
|
|
|
0
|
if ($self->testRangeDetect($text, '{', '}', 0, 0, undef, 0, '#stay', 'String (interpolated)')) { |
1292
|
0
|
|
|
|
|
0
|
return 1 |
1293
|
|
|
|
|
|
|
} |
1294
|
|
|
|
|
|
|
# attribute => 'Operator' |
1295
|
|
|
|
|
|
|
# char => '}' |
1296
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
1297
|
|
|
|
|
|
|
# endRegion => 'String' |
1298
|
|
|
|
|
|
|
# type => 'DetectChar' |
1299
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
1300
|
0
|
|
|
|
|
0
|
return 1 |
1301
|
|
|
|
|
|
|
} |
1302
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
1303
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1304
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
1305
|
0
|
|
|
|
|
0
|
return 1 |
1306
|
|
|
|
|
|
|
} |
1307
|
0
|
|
|
|
|
0
|
return 0; |
1308
|
|
|
|
|
|
|
}; |
1309
|
|
|
|
|
|
|
|
1310
|
|
|
|
|
|
|
sub parseip_string_4 { |
1311
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1312
|
|
|
|
|
|
|
# attribute => 'String (interpolated)' |
1313
|
|
|
|
|
|
|
# char => '[' |
1314
|
|
|
|
|
|
|
# char1 => ']' |
1315
|
|
|
|
|
|
|
# context => '#stay' |
1316
|
|
|
|
|
|
|
# type => 'RangeDetect' |
1317
|
0
|
0
|
|
|
|
0
|
if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'String (interpolated)')) { |
1318
|
0
|
|
|
|
|
0
|
return 1 |
1319
|
|
|
|
|
|
|
} |
1320
|
|
|
|
|
|
|
# attribute => 'Operator' |
1321
|
|
|
|
|
|
|
# char => ']' |
1322
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
1323
|
|
|
|
|
|
|
# endRegion => 'String' |
1324
|
|
|
|
|
|
|
# type => 'DetectChar' |
1325
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
1326
|
0
|
|
|
|
|
0
|
return 1 |
1327
|
|
|
|
|
|
|
} |
1328
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
1329
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1330
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
1331
|
0
|
|
|
|
|
0
|
return 1 |
1332
|
|
|
|
|
|
|
} |
1333
|
0
|
|
|
|
|
0
|
return 0; |
1334
|
|
|
|
|
|
|
}; |
1335
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
sub parseip_string_5 { |
1337
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1338
|
|
|
|
|
|
|
# attribute => 'String (interpolated)' |
1339
|
|
|
|
|
|
|
# char => '<' |
1340
|
|
|
|
|
|
|
# char1 => '>' |
1341
|
|
|
|
|
|
|
# context => '#stay' |
1342
|
|
|
|
|
|
|
# type => 'RangeDetect' |
1343
|
0
|
0
|
|
|
|
0
|
if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'String (interpolated)')) { |
1344
|
0
|
|
|
|
|
0
|
return 1 |
1345
|
|
|
|
|
|
|
} |
1346
|
|
|
|
|
|
|
# attribute => 'Operator' |
1347
|
|
|
|
|
|
|
# char => '>' |
1348
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
1349
|
|
|
|
|
|
|
# endRegion => 'String' |
1350
|
|
|
|
|
|
|
# type => 'DetectChar' |
1351
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
1352
|
0
|
|
|
|
|
0
|
return 1 |
1353
|
|
|
|
|
|
|
} |
1354
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
1355
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1356
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
1357
|
0
|
|
|
|
|
0
|
return 1 |
1358
|
|
|
|
|
|
|
} |
1359
|
0
|
|
|
|
|
0
|
return 0; |
1360
|
|
|
|
|
|
|
}; |
1361
|
|
|
|
|
|
|
|
1362
|
|
|
|
|
|
|
sub parseip_string_6 { |
1363
|
20
|
|
|
20
|
0
|
31
|
my ($self, $text) = @_; |
1364
|
|
|
|
|
|
|
# String => '\\%1' |
1365
|
|
|
|
|
|
|
# attribute => 'String (interpolated)' |
1366
|
|
|
|
|
|
|
# context => '#stay' |
1367
|
|
|
|
|
|
|
# dynamic => 'true' |
1368
|
|
|
|
|
|
|
# type => 'RegExpr' |
1369
|
20
|
50
|
|
|
|
45
|
if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'String (interpolated)')) { |
1370
|
0
|
|
|
|
|
0
|
return 1 |
1371
|
|
|
|
|
|
|
} |
1372
|
|
|
|
|
|
|
# attribute => 'Operator' |
1373
|
|
|
|
|
|
|
# char => '1' |
1374
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
1375
|
|
|
|
|
|
|
# dynamic => 'true' |
1376
|
|
|
|
|
|
|
# endRegion => 'String' |
1377
|
|
|
|
|
|
|
# type => 'DetectChar' |
1378
|
20
|
100
|
|
|
|
57
|
if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
1379
|
2
|
|
|
|
|
5
|
return 1 |
1380
|
|
|
|
|
|
|
} |
1381
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
1382
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1383
|
18
|
100
|
|
|
|
41
|
if ($self->includeRules('ipstring_internal', $text)) { |
1384
|
8
|
|
|
|
|
16
|
return 1 |
1385
|
|
|
|
|
|
|
} |
1386
|
10
|
|
|
|
|
18
|
return 0; |
1387
|
|
|
|
|
|
|
}; |
1388
|
|
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
sub parseipstring_internal { |
1390
|
335
|
|
|
335
|
0
|
525
|
my ($self, $text) = @_; |
1391
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
1392
|
335
|
100
|
|
|
|
678
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
1393
|
118
|
|
|
|
|
309
|
return 1 |
1394
|
|
|
|
|
|
|
} |
1395
|
|
|
|
|
|
|
# String => '\\[UuLlEtnaefr]' |
1396
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
1397
|
|
|
|
|
|
|
# context => '#stay' |
1398
|
|
|
|
|
|
|
# type => 'RegExpr' |
1399
|
217
|
100
|
|
|
|
474
|
if ($self->testRegExpr($text, '\\\\[UuLlEtnaefr]', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
1400
|
9
|
|
|
|
|
26
|
return 1 |
1401
|
|
|
|
|
|
|
} |
1402
|
|
|
|
|
|
|
# String => '\\.' |
1403
|
|
|
|
|
|
|
# attribute => 'String (interpolated)' |
1404
|
|
|
|
|
|
|
# context => '#stay' |
1405
|
|
|
|
|
|
|
# type => 'RegExpr' |
1406
|
208
|
100
|
|
|
|
486
|
if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'String (interpolated)')) { |
1407
|
9
|
|
|
|
|
20
|
return 1 |
1408
|
|
|
|
|
|
|
} |
1409
|
|
|
|
|
|
|
# String => '(?:[\$@]\S|%[\w{])' |
1410
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1411
|
|
|
|
|
|
|
# context => 'find_variable_unsafe' |
1412
|
|
|
|
|
|
|
# lookAhead => 'true' |
1413
|
|
|
|
|
|
|
# type => 'RegExpr' |
1414
|
199
|
100
|
|
|
|
462
|
if ($self->testRegExpr($text, '(?:[\\$@]\\S|%[\\w{])', 0, 0, 1, undef, 0, 'find_variable_unsafe', 'Normal Text')) { |
1415
|
24
|
|
|
|
|
61
|
return 1 |
1416
|
|
|
|
|
|
|
} |
1417
|
175
|
|
|
|
|
444
|
return 0; |
1418
|
|
|
|
|
|
|
}; |
1419
|
|
|
|
|
|
|
|
1420
|
|
|
|
|
|
|
sub parsenormal { |
1421
|
14626
|
|
|
14626
|
0
|
21986
|
my ($self, $text) = @_; |
1422
|
|
|
|
|
|
|
# String => '^#!\/.*' |
1423
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1424
|
|
|
|
|
|
|
# context => '#stay' |
1425
|
|
|
|
|
|
|
# type => 'RegExpr' |
1426
|
14626
|
100
|
|
|
|
29091
|
if ($self->testRegExpr($text, '^#!\\/.*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { |
1427
|
2
|
|
|
|
|
7
|
return 1 |
1428
|
|
|
|
|
|
|
} |
1429
|
|
|
|
|
|
|
# String => '__DATA__' |
1430
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1431
|
|
|
|
|
|
|
# context => 'data_handle' |
1432
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
1433
|
|
|
|
|
|
|
# type => 'StringDetect' |
1434
|
14624
|
50
|
|
|
|
31654
|
if ($self->testStringDetect($text, '__DATA__', 0, 0, 0, undef, 1, 'data_handle', 'Keyword')) { |
1435
|
0
|
|
|
|
|
0
|
return 1 |
1436
|
|
|
|
|
|
|
} |
1437
|
|
|
|
|
|
|
# String => '__END__' |
1438
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1439
|
|
|
|
|
|
|
# context => '#stay' |
1440
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
1441
|
|
|
|
|
|
|
# type => 'StringDetect' |
1442
|
14624
|
100
|
|
|
|
29538
|
if ($self->testStringDetect($text, '__END__', 0, 0, 0, undef, 1, '#stay', 'Keyword')) { |
1443
|
2
|
|
|
|
|
5
|
return 1 |
1444
|
|
|
|
|
|
|
} |
1445
|
|
|
|
|
|
|
# String => '\bsub\s+' |
1446
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1447
|
|
|
|
|
|
|
# context => 'sub_name_def' |
1448
|
|
|
|
|
|
|
# type => 'RegExpr' |
1449
|
14622
|
100
|
|
|
|
27347
|
if ($self->testRegExpr($text, '\\bsub\\s+', 0, 0, 0, undef, 0, 'sub_name_def', 'Keyword')) { |
1450
|
81
|
|
|
|
|
204
|
return 1 |
1451
|
|
|
|
|
|
|
} |
1452
|
|
|
|
|
|
|
# String => 'keywords' |
1453
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1454
|
|
|
|
|
|
|
# context => '#stay' |
1455
|
|
|
|
|
|
|
# type => 'keyword' |
1456
|
14541
|
100
|
|
|
|
34734
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) { |
1457
|
543
|
|
|
|
|
1085
|
return 1 |
1458
|
|
|
|
|
|
|
} |
1459
|
|
|
|
|
|
|
# String => 'operators' |
1460
|
|
|
|
|
|
|
# attribute => 'Operator' |
1461
|
|
|
|
|
|
|
# context => '#stay' |
1462
|
|
|
|
|
|
|
# type => 'keyword' |
1463
|
13998
|
100
|
|
|
|
29022
|
if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) { |
1464
|
51
|
|
|
|
|
130
|
return 1 |
1465
|
|
|
|
|
|
|
} |
1466
|
|
|
|
|
|
|
# String => 'functions' |
1467
|
|
|
|
|
|
|
# attribute => 'Function' |
1468
|
|
|
|
|
|
|
# context => '#stay' |
1469
|
|
|
|
|
|
|
# type => 'keyword' |
1470
|
13947
|
100
|
|
|
|
29781
|
if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) { |
1471
|
237
|
|
|
|
|
510
|
return 1 |
1472
|
|
|
|
|
|
|
} |
1473
|
|
|
|
|
|
|
# String => 'pragmas' |
1474
|
|
|
|
|
|
|
# attribute => 'Pragma' |
1475
|
|
|
|
|
|
|
# context => '#stay' |
1476
|
|
|
|
|
|
|
# type => 'keyword' |
1477
|
13710
|
100
|
|
|
|
29334
|
if ($self->testKeyword($text, 'pragmas', 0, undef, 0, '#stay', 'Pragma')) { |
1478
|
14
|
|
|
|
|
31
|
return 1 |
1479
|
|
|
|
|
|
|
} |
1480
|
|
|
|
|
|
|
# String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)(\s|$)' |
1481
|
|
|
|
|
|
|
# attribute => 'Pod' |
1482
|
|
|
|
|
|
|
# beginRegion => 'POD' |
1483
|
|
|
|
|
|
|
# column => '0' |
1484
|
|
|
|
|
|
|
# context => 'pod' |
1485
|
|
|
|
|
|
|
# type => 'RegExpr' |
1486
|
13696
|
100
|
|
|
|
28520
|
if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)(\\s|$)', 0, 0, 0, 0, 0, 'pod', 'Pod')) { |
1487
|
3
|
|
|
|
|
7
|
return 1 |
1488
|
|
|
|
|
|
|
} |
1489
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
1490
|
13693
|
100
|
|
|
|
33759
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
1491
|
58
|
|
|
|
|
124
|
return 1 |
1492
|
|
|
|
|
|
|
} |
1493
|
|
|
|
|
|
|
# attribute => 'Comment' |
1494
|
|
|
|
|
|
|
# char => '#' |
1495
|
|
|
|
|
|
|
# context => 'comment' |
1496
|
|
|
|
|
|
|
# type => 'DetectChar' |
1497
|
13635
|
100
|
|
|
|
29309
|
if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'comment', 'Comment')) { |
1498
|
108
|
|
|
|
|
212
|
return 1 |
1499
|
|
|
|
|
|
|
} |
1500
|
|
|
|
|
|
|
# attribute => 'Octal' |
1501
|
|
|
|
|
|
|
# context => 'slash_safe_escape' |
1502
|
|
|
|
|
|
|
# type => 'HlCOct' |
1503
|
13527
|
50
|
|
|
|
28892
|
if ($self->testHlCOct($text, 0, undef, 0, 'slash_safe_escape', 'Octal')) { |
1504
|
0
|
|
|
|
|
0
|
return 1 |
1505
|
|
|
|
|
|
|
} |
1506
|
|
|
|
|
|
|
# attribute => 'Hex' |
1507
|
|
|
|
|
|
|
# context => 'slash_safe_escape' |
1508
|
|
|
|
|
|
|
# type => 'HlCHex' |
1509
|
13527
|
50
|
|
|
|
29846
|
if ($self->testHlCHex($text, 0, undef, 0, 'slash_safe_escape', 'Hex')) { |
1510
|
0
|
|
|
|
|
0
|
return 1 |
1511
|
|
|
|
|
|
|
} |
1512
|
|
|
|
|
|
|
# attribute => 'Float' |
1513
|
|
|
|
|
|
|
# context => 'slash_safe_escape' |
1514
|
|
|
|
|
|
|
# type => 'Float' |
1515
|
13527
|
100
|
|
|
|
27931
|
if ($self->testFloat($text, 0, undef, 0, 'slash_safe_escape', 'Float')) { |
1516
|
59
|
|
|
|
|
134
|
return 1 |
1517
|
|
|
|
|
|
|
} |
1518
|
|
|
|
|
|
|
# attribute => 'Decimal' |
1519
|
|
|
|
|
|
|
# context => 'slash_safe_escape' |
1520
|
|
|
|
|
|
|
# type => 'Int' |
1521
|
13468
|
100
|
|
|
|
28153
|
if ($self->testInt($text, 0, undef, 0, 'slash_safe_escape', 'Decimal')) { |
1522
|
2
|
|
|
|
|
4
|
return 1 |
1523
|
|
|
|
|
|
|
} |
1524
|
|
|
|
|
|
|
# String => '\\(["'])[^\1]' |
1525
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1526
|
|
|
|
|
|
|
# context => '#stay' |
1527
|
|
|
|
|
|
|
# type => 'RegExpr' |
1528
|
13466
|
50
|
|
|
|
29187
|
if ($self->testRegExpr($text, '\\\\(["\'])[^\\1]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1529
|
0
|
|
|
|
|
0
|
return 1 |
1530
|
|
|
|
|
|
|
} |
1531
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1532
|
|
|
|
|
|
|
# char => '&' |
1533
|
|
|
|
|
|
|
# char1 => ''' |
1534
|
|
|
|
|
|
|
# context => '#stay' |
1535
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
1536
|
13466
|
50
|
|
|
|
32019
|
if ($self->testDetect2Chars($text, '&', '\'', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1537
|
0
|
|
|
|
|
0
|
return 1 |
1538
|
|
|
|
|
|
|
} |
1539
|
|
|
|
|
|
|
# attribute => 'Operator' |
1540
|
|
|
|
|
|
|
# beginRegion => 'String' |
1541
|
|
|
|
|
|
|
# char => '"' |
1542
|
|
|
|
|
|
|
# context => 'ip_string' |
1543
|
|
|
|
|
|
|
# type => 'DetectChar' |
1544
|
13466
|
100
|
|
|
|
28044
|
if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'ip_string', 'Operator')) { |
1545
|
37
|
|
|
|
|
84
|
return 1 |
1546
|
|
|
|
|
|
|
} |
1547
|
|
|
|
|
|
|
# attribute => 'Operator' |
1548
|
|
|
|
|
|
|
# beginRegion => 'String' |
1549
|
|
|
|
|
|
|
# char => ''' |
1550
|
|
|
|
|
|
|
# context => 'string' |
1551
|
|
|
|
|
|
|
# type => 'DetectChar' |
1552
|
13429
|
100
|
|
|
|
25130
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'string', 'Operator')) { |
1553
|
1103
|
|
|
|
|
2300
|
return 1 |
1554
|
|
|
|
|
|
|
} |
1555
|
|
|
|
|
|
|
# attribute => 'Operator' |
1556
|
|
|
|
|
|
|
# char => '`' |
1557
|
|
|
|
|
|
|
# context => 'Backticked' |
1558
|
|
|
|
|
|
|
# type => 'DetectChar' |
1559
|
12326
|
50
|
|
|
|
23311
|
if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Backticked', 'Operator')) { |
1560
|
0
|
|
|
|
|
0
|
return 1 |
1561
|
|
|
|
|
|
|
} |
1562
|
|
|
|
|
|
|
# String => '(?:[$@]\S|%[\w{]|\*[^\d\*{\$@%=(])' |
1563
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1564
|
|
|
|
|
|
|
# context => 'find_variable' |
1565
|
|
|
|
|
|
|
# lookAhead => 'true' |
1566
|
|
|
|
|
|
|
# type => 'RegExpr' |
1567
|
12326
|
100
|
|
|
|
23330
|
if ($self->testRegExpr($text, '(?:[$@]\\S|%[\\w{]|\\*[^\\d\\*{\\$@%=(])', 0, 0, 1, undef, 0, 'find_variable', 'Normal Text')) { |
1568
|
1074
|
|
|
|
|
2223
|
return 1 |
1569
|
|
|
|
|
|
|
} |
1570
|
|
|
|
|
|
|
# String => '<[A-Z0-9_]+>' |
1571
|
|
|
|
|
|
|
# attribute => 'Keyword' |
1572
|
|
|
|
|
|
|
# context => '#stay' |
1573
|
|
|
|
|
|
|
# type => 'RegExpr' |
1574
|
11252
|
50
|
|
|
|
27731
|
if ($self->testRegExpr($text, '<[A-Z0-9_]+>', 0, 0, 0, undef, 0, '#stay', 'Keyword')) { |
1575
|
0
|
|
|
|
|
0
|
return 1 |
1576
|
|
|
|
|
|
|
} |
1577
|
|
|
|
|
|
|
# String => '\s*<<(?=\w+|\s*["'])' |
1578
|
|
|
|
|
|
|
# attribute => 'Operator' |
1579
|
|
|
|
|
|
|
# beginRegion => 'HereDocument' |
1580
|
|
|
|
|
|
|
# context => 'find_here_document' |
1581
|
|
|
|
|
|
|
# type => 'RegExpr' |
1582
|
11252
|
100
|
|
|
|
24956
|
if ($self->testRegExpr($text, '\\s*<<(?=\\w+|\\s*["\'])', 0, 0, 0, undef, 0, 'find_here_document', 'Operator')) { |
1583
|
3
|
|
|
|
|
10
|
return 1 |
1584
|
|
|
|
|
|
|
} |
1585
|
|
|
|
|
|
|
# String => '\s*\}\s*/' |
1586
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1587
|
|
|
|
|
|
|
# context => '#stay' |
1588
|
|
|
|
|
|
|
# endRegion => 'Block' |
1589
|
|
|
|
|
|
|
# type => 'RegExpr' |
1590
|
11249
|
50
|
|
|
|
25892
|
if ($self->testRegExpr($text, '\\s*\\}\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1591
|
0
|
|
|
|
|
0
|
return 1 |
1592
|
|
|
|
|
|
|
} |
1593
|
|
|
|
|
|
|
# String => '\s*[)]\s*/' |
1594
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1595
|
|
|
|
|
|
|
# context => '#stay' |
1596
|
|
|
|
|
|
|
# type => 'RegExpr' |
1597
|
11249
|
50
|
|
|
|
25026
|
if ($self->testRegExpr($text, '\\s*[)]\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1598
|
0
|
|
|
|
|
0
|
return 1 |
1599
|
|
|
|
|
|
|
} |
1600
|
|
|
|
|
|
|
# String => '\w+::' |
1601
|
|
|
|
|
|
|
# attribute => 'Function' |
1602
|
|
|
|
|
|
|
# context => 'sub_name_def' |
1603
|
|
|
|
|
|
|
# type => 'RegExpr' |
1604
|
11249
|
100
|
|
|
|
25041
|
if ($self->testRegExpr($text, '\\w+::', 0, 0, 0, undef, 0, 'sub_name_def', 'Function')) { |
1605
|
6
|
|
|
|
|
15
|
return 1 |
1606
|
|
|
|
|
|
|
} |
1607
|
|
|
|
|
|
|
# String => '\w+[=]' |
1608
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1609
|
|
|
|
|
|
|
# context => '#stay' |
1610
|
|
|
|
|
|
|
# type => 'RegExpr' |
1611
|
11243
|
50
|
|
|
|
25762
|
if ($self->testRegExpr($text, '\\w+[=]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1612
|
0
|
|
|
|
|
0
|
return 1 |
1613
|
|
|
|
|
|
|
} |
1614
|
|
|
|
|
|
|
# String => '\bq(?=[qwx]?\s*[^\w\s])' |
1615
|
|
|
|
|
|
|
# attribute => 'Operator' |
1616
|
|
|
|
|
|
|
# context => 'find_quoted' |
1617
|
|
|
|
|
|
|
# type => 'RegExpr' |
1618
|
11243
|
100
|
|
|
|
25622
|
if ($self->testRegExpr($text, '\\bq(?=[qwx]?\\s*[^\\w\\s])', 0, 0, 0, undef, 0, 'find_quoted', 'Operator')) { |
1619
|
7
|
|
|
|
|
16
|
return 1 |
1620
|
|
|
|
|
|
|
} |
1621
|
|
|
|
|
|
|
# String => '\bs(?=\s*[^\w\s])' |
1622
|
|
|
|
|
|
|
# attribute => 'Operator' |
1623
|
|
|
|
|
|
|
# context => 'find_subst' |
1624
|
|
|
|
|
|
|
# type => 'RegExpr' |
1625
|
11236
|
100
|
|
|
|
25525
|
if ($self->testRegExpr($text, '\\bs(?=\\s*[^\\w\\s])', 0, 0, 0, undef, 0, 'find_subst', 'Operator')) { |
1626
|
26
|
|
|
|
|
58
|
return 1 |
1627
|
|
|
|
|
|
|
} |
1628
|
|
|
|
|
|
|
# String => '\b(?:tr|y)\s*(?=[^\w\s\]})])' |
1629
|
|
|
|
|
|
|
# attribute => 'Operator' |
1630
|
|
|
|
|
|
|
# context => 'tr' |
1631
|
|
|
|
|
|
|
# type => 'RegExpr' |
1632
|
11210
|
50
|
|
|
|
25808
|
if ($self->testRegExpr($text, '\\b(?:tr|y)\\s*(?=[^\\w\\s\\]})])', 0, 0, 0, undef, 0, 'tr', 'Operator')) { |
1633
|
0
|
|
|
|
|
0
|
return 1 |
1634
|
|
|
|
|
|
|
} |
1635
|
|
|
|
|
|
|
# String => '\b(?:m|qr)(?=\s*[^\w\s\]})])' |
1636
|
|
|
|
|
|
|
# attribute => 'Operator' |
1637
|
|
|
|
|
|
|
# context => 'find_pattern' |
1638
|
|
|
|
|
|
|
# type => 'RegExpr' |
1639
|
11210
|
100
|
|
|
|
25261
|
if ($self->testRegExpr($text, '\\b(?:m|qr)(?=\\s*[^\\w\\s\\]})])', 0, 0, 0, undef, 0, 'find_pattern', 'Operator')) { |
1640
|
3
|
|
|
|
|
9
|
return 1 |
1641
|
|
|
|
|
|
|
} |
1642
|
|
|
|
|
|
|
# String => '[\w_]+\s*/' |
1643
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1644
|
|
|
|
|
|
|
# context => '#stay' |
1645
|
|
|
|
|
|
|
# type => 'RegExpr' |
1646
|
11207
|
100
|
|
|
|
25807
|
if ($self->testRegExpr($text, '[\\w_]+\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1647
|
2
|
|
|
|
|
7
|
return 1 |
1648
|
|
|
|
|
|
|
} |
1649
|
|
|
|
|
|
|
# String => '[<>"':]/' |
1650
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1651
|
|
|
|
|
|
|
# context => '#stay' |
1652
|
|
|
|
|
|
|
# type => 'RegExpr' |
1653
|
11205
|
50
|
|
|
|
28666
|
if ($self->testRegExpr($text, '[<>"\':]/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1654
|
0
|
|
|
|
|
0
|
return 1 |
1655
|
|
|
|
|
|
|
} |
1656
|
|
|
|
|
|
|
# attribute => 'Operator' |
1657
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
1658
|
|
|
|
|
|
|
# char => '/' |
1659
|
|
|
|
|
|
|
# context => 'pattern_slash' |
1660
|
|
|
|
|
|
|
# type => 'DetectChar' |
1661
|
11205
|
100
|
|
|
|
26699
|
if ($self->testDetectChar($text, '/', 0, 0, 0, undef, 0, 'pattern_slash', 'Operator')) { |
1662
|
29
|
|
|
|
|
76
|
return 1 |
1663
|
|
|
|
|
|
|
} |
1664
|
|
|
|
|
|
|
# String => '-[rwxoRWXOeszfdlpSbctugkTBMAC]' |
1665
|
|
|
|
|
|
|
# attribute => 'Operator' |
1666
|
|
|
|
|
|
|
# context => '#stay' |
1667
|
|
|
|
|
|
|
# type => 'RegExpr' |
1668
|
11176
|
100
|
|
|
|
22923
|
if ($self->testRegExpr($text, '-[rwxoRWXOeszfdlpSbctugkTBMAC]', 0, 0, 0, undef, 0, '#stay', 'Operator')) { |
1669
|
2
|
|
|
|
|
6
|
return 1 |
1670
|
|
|
|
|
|
|
} |
1671
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1672
|
|
|
|
|
|
|
# beginRegion => 'Block' |
1673
|
|
|
|
|
|
|
# char => '{' |
1674
|
|
|
|
|
|
|
# context => '#stay' |
1675
|
|
|
|
|
|
|
# type => 'DetectChar' |
1676
|
11174
|
100
|
|
|
|
24527
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1677
|
368
|
|
|
|
|
766
|
return 1 |
1678
|
|
|
|
|
|
|
} |
1679
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1680
|
|
|
|
|
|
|
# char => '}' |
1681
|
|
|
|
|
|
|
# context => '#stay' |
1682
|
|
|
|
|
|
|
# endRegion => 'Block' |
1683
|
|
|
|
|
|
|
# type => 'DetectChar' |
1684
|
10806
|
100
|
|
|
|
21202
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1685
|
368
|
|
|
|
|
787
|
return 1 |
1686
|
|
|
|
|
|
|
} |
1687
|
10438
|
|
|
|
|
19034
|
return 0; |
1688
|
|
|
|
|
|
|
}; |
1689
|
|
|
|
|
|
|
|
1690
|
|
|
|
|
|
|
sub parsepackage_qualified_blank { |
1691
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1692
|
|
|
|
|
|
|
# String => '[\w_]+' |
1693
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1694
|
|
|
|
|
|
|
# context => '#pop' |
1695
|
|
|
|
|
|
|
# type => 'RegExpr' |
1696
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '[\\w_]+', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
1697
|
0
|
|
|
|
|
0
|
return 1 |
1698
|
|
|
|
|
|
|
} |
1699
|
0
|
|
|
|
|
0
|
return 0; |
1700
|
|
|
|
|
|
|
}; |
1701
|
|
|
|
|
|
|
|
1702
|
|
|
|
|
|
|
sub parsepat_char_class { |
1703
|
139
|
|
|
139
|
0
|
211
|
my ($self, $text) = @_; |
1704
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
1705
|
|
|
|
|
|
|
# char => '^' |
1706
|
|
|
|
|
|
|
# context => '#stay' |
1707
|
|
|
|
|
|
|
# type => 'DetectChar' |
1708
|
139
|
100
|
|
|
|
277
|
if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
1709
|
4
|
|
|
|
|
10
|
return 1 |
1710
|
|
|
|
|
|
|
} |
1711
|
|
|
|
|
|
|
# attribute => 'Pattern Character Class' |
1712
|
|
|
|
|
|
|
# char => '\' |
1713
|
|
|
|
|
|
|
# char1 => '\' |
1714
|
|
|
|
|
|
|
# context => '#stay' |
1715
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
1716
|
135
|
100
|
|
|
|
285
|
if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { |
1717
|
2
|
|
|
|
|
4
|
return 1 |
1718
|
|
|
|
|
|
|
} |
1719
|
|
|
|
|
|
|
# attribute => 'Pattern Character Class' |
1720
|
|
|
|
|
|
|
# char => '\' |
1721
|
|
|
|
|
|
|
# char1 => ']' |
1722
|
|
|
|
|
|
|
# context => '#stay' |
1723
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
1724
|
133
|
50
|
|
|
|
260
|
if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { |
1725
|
0
|
|
|
|
|
0
|
return 1 |
1726
|
|
|
|
|
|
|
} |
1727
|
|
|
|
|
|
|
# String => '\[:^?[a-z]+:\]' |
1728
|
|
|
|
|
|
|
# attribute => 'Pattern Character Class' |
1729
|
|
|
|
|
|
|
# context => '#stay' |
1730
|
|
|
|
|
|
|
# type => 'RegExpr' |
1731
|
133
|
50
|
|
|
|
246
|
if ($self->testRegExpr($text, '\\[:^?[a-z]+:\\]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { |
1732
|
0
|
|
|
|
|
0
|
return 1 |
1733
|
|
|
|
|
|
|
} |
1734
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
1735
|
|
|
|
|
|
|
# char => ']' |
1736
|
|
|
|
|
|
|
# context => '#pop' |
1737
|
|
|
|
|
|
|
# type => 'DetectChar' |
1738
|
133
|
100
|
|
|
|
293
|
if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) { |
1739
|
18
|
|
|
|
|
34
|
return 1 |
1740
|
|
|
|
|
|
|
} |
1741
|
115
|
|
|
|
|
191
|
return 0; |
1742
|
|
|
|
|
|
|
}; |
1743
|
|
|
|
|
|
|
|
1744
|
|
|
|
|
|
|
sub parsepat_ext { |
1745
|
3
|
|
|
3
|
0
|
5
|
my ($self, $text) = @_; |
1746
|
|
|
|
|
|
|
# String => '\#[^)]*' |
1747
|
|
|
|
|
|
|
# attribute => 'Comment' |
1748
|
|
|
|
|
|
|
# context => '#pop' |
1749
|
|
|
|
|
|
|
# type => 'RegExpr' |
1750
|
3
|
50
|
|
|
|
9
|
if ($self->testRegExpr($text, '\\#[^)]*', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
1751
|
0
|
|
|
|
|
0
|
return 1 |
1752
|
|
|
|
|
|
|
} |
1753
|
|
|
|
|
|
|
# String => '[:=!><]+' |
1754
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
1755
|
|
|
|
|
|
|
# context => '#pop' |
1756
|
|
|
|
|
|
|
# type => 'RegExpr' |
1757
|
3
|
50
|
|
|
|
10
|
if ($self->testRegExpr($text, '[:=!><]+', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) { |
1758
|
3
|
|
|
|
|
7
|
return 1 |
1759
|
|
|
|
|
|
|
} |
1760
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
1761
|
|
|
|
|
|
|
# char => ')' |
1762
|
|
|
|
|
|
|
# context => '#pop' |
1763
|
|
|
|
|
|
|
# type => 'DetectChar' |
1764
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) { |
1765
|
0
|
|
|
|
|
0
|
return 1 |
1766
|
|
|
|
|
|
|
} |
1767
|
0
|
|
|
|
|
0
|
return 0; |
1768
|
|
|
|
|
|
|
}; |
1769
|
|
|
|
|
|
|
|
1770
|
|
|
|
|
|
|
sub parsepattern { |
1771
|
14
|
|
|
14
|
0
|
26
|
my ($self, $text) = @_; |
1772
|
|
|
|
|
|
|
# String => '\$(?=%1)' |
1773
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
1774
|
|
|
|
|
|
|
# context => '#stay' |
1775
|
|
|
|
|
|
|
# dynamic => 'true' |
1776
|
|
|
|
|
|
|
# type => 'RegExpr' |
1777
|
14
|
50
|
|
|
|
35
|
if ($self->testRegExpr($text, '\\$(?=%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
1778
|
0
|
|
|
|
|
0
|
return 1 |
1779
|
|
|
|
|
|
|
} |
1780
|
|
|
|
|
|
|
# String => '%1[cgimosx]*' |
1781
|
|
|
|
|
|
|
# attribute => 'Operator' |
1782
|
|
|
|
|
|
|
# context => '#pop#pop' |
1783
|
|
|
|
|
|
|
# dynamic => 'true' |
1784
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
1785
|
|
|
|
|
|
|
# type => 'RegExpr' |
1786
|
14
|
100
|
|
|
|
35
|
if ($self->testRegExpr($text, '%1[cgimosx]*', 0, 1, 0, undef, 0, '#pop#pop', 'Operator')) { |
1787
|
3
|
|
|
|
|
10
|
return 1 |
1788
|
|
|
|
|
|
|
} |
1789
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
1790
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1791
|
11
|
100
|
|
|
|
31
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
1792
|
9
|
|
|
|
|
21
|
return 1 |
1793
|
|
|
|
|
|
|
} |
1794
|
|
|
|
|
|
|
# String => '\$(?=\%1)' |
1795
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
1796
|
|
|
|
|
|
|
# context => '#stay' |
1797
|
|
|
|
|
|
|
# dynamic => 'true' |
1798
|
|
|
|
|
|
|
# type => 'RegExpr' |
1799
|
2
|
50
|
|
|
|
8
|
if ($self->testRegExpr($text, '\\$(?=\\%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
1800
|
0
|
|
|
|
|
0
|
return 1 |
1801
|
|
|
|
|
|
|
} |
1802
|
2
|
|
|
|
|
4
|
return 0; |
1803
|
|
|
|
|
|
|
}; |
1804
|
|
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
sub parsepattern_brace { |
1806
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1807
|
|
|
|
|
|
|
# String => '\}[cgimosx]*' |
1808
|
|
|
|
|
|
|
# attribute => 'Operator' |
1809
|
|
|
|
|
|
|
# context => '#pop#pop' |
1810
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
1811
|
|
|
|
|
|
|
# type => 'RegExpr' |
1812
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\}[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { |
1813
|
0
|
|
|
|
|
0
|
return 1 |
1814
|
|
|
|
|
|
|
} |
1815
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
1816
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1817
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
1818
|
0
|
|
|
|
|
0
|
return 1 |
1819
|
|
|
|
|
|
|
} |
1820
|
0
|
|
|
|
|
0
|
return 0; |
1821
|
|
|
|
|
|
|
}; |
1822
|
|
|
|
|
|
|
|
1823
|
|
|
|
|
|
|
sub parsepattern_bracket { |
1824
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1825
|
|
|
|
|
|
|
# String => '\][cgimosx]*' |
1826
|
|
|
|
|
|
|
# attribute => 'Operator' |
1827
|
|
|
|
|
|
|
# context => '#pop#pop' |
1828
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
1829
|
|
|
|
|
|
|
# type => 'RegExpr' |
1830
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\][cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { |
1831
|
0
|
|
|
|
|
0
|
return 1 |
1832
|
|
|
|
|
|
|
} |
1833
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
1834
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1835
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
1836
|
0
|
|
|
|
|
0
|
return 1 |
1837
|
|
|
|
|
|
|
} |
1838
|
0
|
|
|
|
|
0
|
return 0; |
1839
|
|
|
|
|
|
|
}; |
1840
|
|
|
|
|
|
|
|
1841
|
|
|
|
|
|
|
sub parsepattern_paren { |
1842
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1843
|
|
|
|
|
|
|
# String => '\)[cgimosx]*' |
1844
|
|
|
|
|
|
|
# attribute => 'Operator' |
1845
|
|
|
|
|
|
|
# context => '#pop#pop' |
1846
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
1847
|
|
|
|
|
|
|
# type => 'RegExpr' |
1848
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\)[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { |
1849
|
0
|
|
|
|
|
0
|
return 1 |
1850
|
|
|
|
|
|
|
} |
1851
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
1852
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1853
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
1854
|
0
|
|
|
|
|
0
|
return 1 |
1855
|
|
|
|
|
|
|
} |
1856
|
0
|
|
|
|
|
0
|
return 0; |
1857
|
|
|
|
|
|
|
}; |
1858
|
|
|
|
|
|
|
|
1859
|
|
|
|
|
|
|
sub parsepattern_slash { |
1860
|
176
|
|
|
176
|
0
|
274
|
my ($self, $text) = @_; |
1861
|
|
|
|
|
|
|
# String => '\$(?=/)' |
1862
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
1863
|
|
|
|
|
|
|
# context => '#stay' |
1864
|
|
|
|
|
|
|
# type => 'RegExpr' |
1865
|
176
|
100
|
|
|
|
370
|
if ($self->testRegExpr($text, '\\$(?=/)', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
1866
|
3
|
|
|
|
|
8
|
return 1 |
1867
|
|
|
|
|
|
|
} |
1868
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
1869
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1870
|
173
|
100
|
|
|
|
406
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
1871
|
115
|
|
|
|
|
222
|
return 1 |
1872
|
|
|
|
|
|
|
} |
1873
|
|
|
|
|
|
|
# String => '/[cgimosx]*' |
1874
|
|
|
|
|
|
|
# attribute => 'Operator' |
1875
|
|
|
|
|
|
|
# context => '#pop' |
1876
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
1877
|
|
|
|
|
|
|
# type => 'RegExpr' |
1878
|
58
|
100
|
|
|
|
152
|
if ($self->testRegExpr($text, '/[cgimosx]*', 0, 0, 0, undef, 0, '#pop', 'Operator')) { |
1879
|
29
|
|
|
|
|
66
|
return 1 |
1880
|
|
|
|
|
|
|
} |
1881
|
29
|
|
|
|
|
63
|
return 0; |
1882
|
|
|
|
|
|
|
}; |
1883
|
|
|
|
|
|
|
|
1884
|
|
|
|
|
|
|
sub parsepattern_sq { |
1885
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1886
|
|
|
|
|
|
|
# String => ''[cgimosx]*' |
1887
|
|
|
|
|
|
|
# attribute => 'Operator' |
1888
|
|
|
|
|
|
|
# context => '#pop#pop' |
1889
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
1890
|
|
|
|
|
|
|
# type => 'RegExpr' |
1891
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\'[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { |
1892
|
0
|
|
|
|
|
0
|
return 1 |
1893
|
|
|
|
|
|
|
} |
1894
|
|
|
|
|
|
|
# context => 'regex_pattern_internal' |
1895
|
|
|
|
|
|
|
# type => 'IncludeRules' |
1896
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal', $text)) { |
1897
|
0
|
|
|
|
|
0
|
return 1 |
1898
|
|
|
|
|
|
|
} |
1899
|
0
|
|
|
|
|
0
|
return 0; |
1900
|
|
|
|
|
|
|
}; |
1901
|
|
|
|
|
|
|
|
1902
|
|
|
|
|
|
|
sub parsepod { |
1903
|
10763
|
|
|
10763
|
0
|
15975
|
my ($self, $text) = @_; |
1904
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
1905
|
10763
|
100
|
|
|
|
20325
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
1906
|
340
|
|
|
|
|
614
|
return 1 |
1907
|
|
|
|
|
|
|
} |
1908
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
1909
|
10423
|
100
|
|
|
|
21243
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
1910
|
2182
|
|
|
|
|
3924
|
return 1 |
1911
|
|
|
|
|
|
|
} |
1912
|
|
|
|
|
|
|
# String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*' |
1913
|
|
|
|
|
|
|
# attribute => 'Pod' |
1914
|
|
|
|
|
|
|
# beginRegion => 'POD' |
1915
|
|
|
|
|
|
|
# column => '0' |
1916
|
|
|
|
|
|
|
# context => '#stay' |
1917
|
|
|
|
|
|
|
# endRegion => 'POD' |
1918
|
|
|
|
|
|
|
# type => 'RegExpr' |
1919
|
8241
|
100
|
|
|
|
15831
|
if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s*.*', 0, 0, 0, 0, 0, '#stay', 'Pod')) { |
1920
|
90
|
|
|
|
|
171
|
return 1 |
1921
|
|
|
|
|
|
|
} |
1922
|
|
|
|
|
|
|
# String => '\=cut\b.*' |
1923
|
|
|
|
|
|
|
# attribute => 'Pod' |
1924
|
|
|
|
|
|
|
# column => '0' |
1925
|
|
|
|
|
|
|
# context => '#pop' |
1926
|
|
|
|
|
|
|
# endRegion => 'POD' |
1927
|
|
|
|
|
|
|
# type => 'RegExpr' |
1928
|
8151
|
100
|
|
|
|
18488
|
if ($self->testRegExpr($text, '\\=cut\\b.*', 0, 0, 0, 0, 0, '#pop', 'Pod')) { |
1929
|
2
|
|
|
|
|
5
|
return 1 |
1930
|
|
|
|
|
|
|
} |
1931
|
8149
|
|
|
|
|
14160
|
return 0; |
1932
|
|
|
|
|
|
|
}; |
1933
|
|
|
|
|
|
|
|
1934
|
|
|
|
|
|
|
sub parsequote_word { |
1935
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1936
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
1937
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
1938
|
0
|
|
|
|
|
0
|
return 1 |
1939
|
|
|
|
|
|
|
} |
1940
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
1941
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
1942
|
0
|
|
|
|
|
0
|
return 1 |
1943
|
|
|
|
|
|
|
} |
1944
|
|
|
|
|
|
|
# String => '\\%1' |
1945
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1946
|
|
|
|
|
|
|
# context => '#stay' |
1947
|
|
|
|
|
|
|
# dynamic => 'true' |
1948
|
|
|
|
|
|
|
# type => 'RegExpr' |
1949
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'Normal Text')) { |
1950
|
0
|
|
|
|
|
0
|
return 1 |
1951
|
|
|
|
|
|
|
} |
1952
|
|
|
|
|
|
|
# attribute => 'Operator' |
1953
|
|
|
|
|
|
|
# char => '1' |
1954
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
1955
|
|
|
|
|
|
|
# dynamic => 'true' |
1956
|
|
|
|
|
|
|
# endRegion => 'Wordlist' |
1957
|
|
|
|
|
|
|
# type => 'DetectChar' |
1958
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
1959
|
0
|
|
|
|
|
0
|
return 1 |
1960
|
|
|
|
|
|
|
} |
1961
|
0
|
|
|
|
|
0
|
return 0; |
1962
|
|
|
|
|
|
|
}; |
1963
|
|
|
|
|
|
|
|
1964
|
|
|
|
|
|
|
sub parsequote_word_brace { |
1965
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1966
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
1967
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
1968
|
0
|
|
|
|
|
0
|
return 1 |
1969
|
|
|
|
|
|
|
} |
1970
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
1971
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
1972
|
0
|
|
|
|
|
0
|
return 1 |
1973
|
|
|
|
|
|
|
} |
1974
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
1975
|
|
|
|
|
|
|
# char => '\' |
1976
|
|
|
|
|
|
|
# char1 => '}' |
1977
|
|
|
|
|
|
|
# context => '#stay' |
1978
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
1979
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
1980
|
0
|
|
|
|
|
0
|
return 1 |
1981
|
|
|
|
|
|
|
} |
1982
|
|
|
|
|
|
|
# attribute => 'Operator' |
1983
|
|
|
|
|
|
|
# char => '}' |
1984
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
1985
|
|
|
|
|
|
|
# endRegion => 'Wordlist' |
1986
|
|
|
|
|
|
|
# type => 'DetectChar' |
1987
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
1988
|
0
|
|
|
|
|
0
|
return 1 |
1989
|
|
|
|
|
|
|
} |
1990
|
0
|
|
|
|
|
0
|
return 0; |
1991
|
|
|
|
|
|
|
}; |
1992
|
|
|
|
|
|
|
|
1993
|
|
|
|
|
|
|
sub parsequote_word_bracket { |
1994
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
1995
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
1996
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
1997
|
0
|
|
|
|
|
0
|
return 1 |
1998
|
|
|
|
|
|
|
} |
1999
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
2000
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
2001
|
0
|
|
|
|
|
0
|
return 1 |
2002
|
|
|
|
|
|
|
} |
2003
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2004
|
|
|
|
|
|
|
# char => '\' |
2005
|
|
|
|
|
|
|
# char1 => ']' |
2006
|
|
|
|
|
|
|
# context => '#stay' |
2007
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2008
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
2009
|
0
|
|
|
|
|
0
|
return 1 |
2010
|
|
|
|
|
|
|
} |
2011
|
|
|
|
|
|
|
# attribute => 'Operator' |
2012
|
|
|
|
|
|
|
# char => ']' |
2013
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
2014
|
|
|
|
|
|
|
# endRegion => 'Wordlist' |
2015
|
|
|
|
|
|
|
# type => 'DetectChar' |
2016
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
2017
|
0
|
|
|
|
|
0
|
return 1 |
2018
|
|
|
|
|
|
|
} |
2019
|
0
|
|
|
|
|
0
|
return 0; |
2020
|
|
|
|
|
|
|
}; |
2021
|
|
|
|
|
|
|
|
2022
|
|
|
|
|
|
|
sub parsequote_word_paren { |
2023
|
14
|
|
|
14
|
0
|
22
|
my ($self, $text) = @_; |
2024
|
|
|
|
|
|
|
# type => 'DetectSpaces' |
2025
|
14
|
50
|
|
|
|
34
|
if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { |
2026
|
0
|
|
|
|
|
0
|
return 1 |
2027
|
|
|
|
|
|
|
} |
2028
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
2029
|
14
|
100
|
|
|
|
34
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
2030
|
7
|
|
|
|
|
15
|
return 1 |
2031
|
|
|
|
|
|
|
} |
2032
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2033
|
|
|
|
|
|
|
# char => '\' |
2034
|
|
|
|
|
|
|
# char1 => ')' |
2035
|
|
|
|
|
|
|
# context => '#stay' |
2036
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2037
|
7
|
50
|
|
|
|
20
|
if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
2038
|
0
|
|
|
|
|
0
|
return 1 |
2039
|
|
|
|
|
|
|
} |
2040
|
|
|
|
|
|
|
# attribute => 'Operator' |
2041
|
|
|
|
|
|
|
# char => ')' |
2042
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
2043
|
|
|
|
|
|
|
# endRegion => 'Wordlist' |
2044
|
|
|
|
|
|
|
# type => 'DetectChar' |
2045
|
7
|
100
|
|
|
|
18
|
if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
2046
|
3
|
|
|
|
|
8
|
return 1 |
2047
|
|
|
|
|
|
|
} |
2048
|
4
|
|
|
|
|
9
|
return 0; |
2049
|
|
|
|
|
|
|
}; |
2050
|
|
|
|
|
|
|
|
2051
|
|
|
|
|
|
|
sub parseregex_pattern_internal { |
2052
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2053
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_rules_1' |
2054
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2055
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal_rules_1', $text)) { |
2056
|
0
|
|
|
|
|
0
|
return 1 |
2057
|
|
|
|
|
|
|
} |
2058
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_rules_2' |
2059
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2060
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal_rules_2', $text)) { |
2061
|
0
|
|
|
|
|
0
|
return 1 |
2062
|
|
|
|
|
|
|
} |
2063
|
0
|
|
|
|
|
0
|
return 0; |
2064
|
|
|
|
|
|
|
}; |
2065
|
|
|
|
|
|
|
|
2066
|
|
|
|
|
|
|
sub parseregex_pattern_internal_ip { |
2067
|
260
|
|
|
260
|
0
|
427
|
my ($self, $text) = @_; |
2068
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_rules_1' |
2069
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2070
|
260
|
100
|
|
|
|
484
|
if ($self->includeRules('regex_pattern_internal_rules_1', $text)) { |
2071
|
36
|
|
|
|
|
78
|
return 1 |
2072
|
|
|
|
|
|
|
} |
2073
|
|
|
|
|
|
|
# String => '[$@][^]\s{}()|>']' |
2074
|
|
|
|
|
|
|
# attribute => 'Data Type' |
2075
|
|
|
|
|
|
|
# context => 'find_variable_unsafe' |
2076
|
|
|
|
|
|
|
# lookAhead => 'true' |
2077
|
|
|
|
|
|
|
# type => 'RegExpr' |
2078
|
224
|
100
|
|
|
|
513
|
if ($self->testRegExpr($text, '[$@][^]\\s{}()|>\']', 0, 0, 1, undef, 0, 'find_variable_unsafe', 'Data Type')) { |
2079
|
5
|
|
|
|
|
15
|
return 1 |
2080
|
|
|
|
|
|
|
} |
2081
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_rules_2' |
2082
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2083
|
219
|
100
|
|
|
|
502
|
if ($self->includeRules('regex_pattern_internal_rules_2', $text)) { |
2084
|
130
|
|
|
|
|
287
|
return 1 |
2085
|
|
|
|
|
|
|
} |
2086
|
89
|
|
|
|
|
207
|
return 0; |
2087
|
|
|
|
|
|
|
}; |
2088
|
|
|
|
|
|
|
|
2089
|
|
|
|
|
|
|
sub parseregex_pattern_internal_rules_1 { |
2090
|
260
|
|
|
260
|
0
|
389
|
my ($self, $text) = @_; |
2091
|
|
|
|
|
|
|
# String => '#.*$' |
2092
|
|
|
|
|
|
|
# attribute => 'Comment' |
2093
|
|
|
|
|
|
|
# context => '#stay' |
2094
|
|
|
|
|
|
|
# firstNonSpace => 'true' |
2095
|
|
|
|
|
|
|
# type => 'RegExpr' |
2096
|
260
|
50
|
|
|
|
556
|
if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) { |
2097
|
0
|
|
|
|
|
0
|
return 1 |
2098
|
|
|
|
|
|
|
} |
2099
|
|
|
|
|
|
|
# String => '\\[anDdSsWw]' |
2100
|
|
|
|
|
|
|
# attribute => 'Pattern Character Class' |
2101
|
|
|
|
|
|
|
# context => '#stay' |
2102
|
|
|
|
|
|
|
# type => 'RegExpr' |
2103
|
260
|
100
|
|
|
|
582
|
if ($self->testRegExpr($text, '\\\\[anDdSsWw]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) { |
2104
|
20
|
|
|
|
|
55
|
return 1 |
2105
|
|
|
|
|
|
|
} |
2106
|
|
|
|
|
|
|
# String => '\\[ABbEGLlNUuQdQZz]' |
2107
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
2108
|
|
|
|
|
|
|
# context => '#stay' |
2109
|
|
|
|
|
|
|
# type => 'RegExpr' |
2110
|
240
|
50
|
|
|
|
555
|
if ($self->testRegExpr($text, '\\\\[ABbEGLlNUuQdQZz]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
2111
|
0
|
|
|
|
|
0
|
return 1 |
2112
|
|
|
|
|
|
|
} |
2113
|
|
|
|
|
|
|
# String => '\\[\d]+' |
2114
|
|
|
|
|
|
|
# attribute => 'Special Variable' |
2115
|
|
|
|
|
|
|
# context => '#stay' |
2116
|
|
|
|
|
|
|
# type => 'RegExpr' |
2117
|
240
|
50
|
|
|
|
545
|
if ($self->testRegExpr($text, '\\\\[\\d]+', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) { |
2118
|
0
|
|
|
|
|
0
|
return 1 |
2119
|
|
|
|
|
|
|
} |
2120
|
|
|
|
|
|
|
# String => '\\.' |
2121
|
|
|
|
|
|
|
# attribute => 'Pattern' |
2122
|
|
|
|
|
|
|
# context => '#stay' |
2123
|
|
|
|
|
|
|
# type => 'RegExpr' |
2124
|
240
|
100
|
|
|
|
579
|
if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Pattern')) { |
2125
|
16
|
|
|
|
|
41
|
return 1 |
2126
|
|
|
|
|
|
|
} |
2127
|
224
|
|
|
|
|
527
|
return 0; |
2128
|
|
|
|
|
|
|
}; |
2129
|
|
|
|
|
|
|
|
2130
|
|
|
|
|
|
|
sub parseregex_pattern_internal_rules_2 { |
2131
|
219
|
|
|
219
|
0
|
385
|
my ($self, $text) = @_; |
2132
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
2133
|
|
|
|
|
|
|
# char => '(' |
2134
|
|
|
|
|
|
|
# char1 => '?' |
2135
|
|
|
|
|
|
|
# context => 'pat_ext' |
2136
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2137
|
219
|
100
|
|
|
|
486
|
if ($self->testDetect2Chars($text, '(', '?', 0, 0, 0, undef, 0, 'pat_ext', 'Pattern Internal Operator')) { |
2138
|
3
|
|
|
|
|
8
|
return 1 |
2139
|
|
|
|
|
|
|
} |
2140
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
2141
|
|
|
|
|
|
|
# char => '[' |
2142
|
|
|
|
|
|
|
# context => 'pat_char_class' |
2143
|
|
|
|
|
|
|
# type => 'DetectChar' |
2144
|
216
|
100
|
|
|
|
471
|
if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'pat_char_class', 'Pattern Internal Operator')) { |
2145
|
18
|
|
|
|
|
45
|
return 1 |
2146
|
|
|
|
|
|
|
} |
2147
|
|
|
|
|
|
|
# String => '[()?^*+|]' |
2148
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
2149
|
|
|
|
|
|
|
# context => '#stay' |
2150
|
|
|
|
|
|
|
# type => 'RegExpr' |
2151
|
198
|
100
|
|
|
|
421
|
if ($self->testRegExpr($text, '[()?^*+|]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
2152
|
109
|
|
|
|
|
276
|
return 1 |
2153
|
|
|
|
|
|
|
} |
2154
|
|
|
|
|
|
|
# String => '\{[\d, ]+\}' |
2155
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
2156
|
|
|
|
|
|
|
# context => '#stay' |
2157
|
|
|
|
|
|
|
# type => 'RegExpr' |
2158
|
89
|
50
|
|
|
|
249
|
if ($self->testRegExpr($text, '\\{[\\d, ]+\\}', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
2159
|
0
|
|
|
|
|
0
|
return 1 |
2160
|
|
|
|
|
|
|
} |
2161
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
2162
|
|
|
|
|
|
|
# char => '$' |
2163
|
|
|
|
|
|
|
# context => '#stay' |
2164
|
|
|
|
|
|
|
# type => 'DetectChar' |
2165
|
89
|
50
|
|
|
|
236
|
if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
2166
|
0
|
|
|
|
|
0
|
return 1 |
2167
|
|
|
|
|
|
|
} |
2168
|
|
|
|
|
|
|
# String => '\s{3,}#.*$' |
2169
|
|
|
|
|
|
|
# attribute => 'Comment' |
2170
|
|
|
|
|
|
|
# context => '#stay' |
2171
|
|
|
|
|
|
|
# type => 'RegExpr' |
2172
|
89
|
50
|
|
|
|
210
|
if ($self->testRegExpr($text, '\\s{3,}#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
2173
|
0
|
|
|
|
|
0
|
return 1 |
2174
|
|
|
|
|
|
|
} |
2175
|
89
|
|
|
|
|
233
|
return 0; |
2176
|
|
|
|
|
|
|
}; |
2177
|
|
|
|
|
|
|
|
2178
|
|
|
|
|
|
|
sub parseslash_safe_escape { |
2179
|
1118
|
|
|
1118
|
0
|
1714
|
my ($self, $text) = @_; |
2180
|
|
|
|
|
|
|
# String => '\s*\]?\s*/' |
2181
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2182
|
|
|
|
|
|
|
# context => '#pop' |
2183
|
|
|
|
|
|
|
# type => 'RegExpr' |
2184
|
1118
|
100
|
|
|
|
2214
|
if ($self->testRegExpr($text, '\\s*\\]?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
2185
|
4
|
|
|
|
|
12
|
return 1 |
2186
|
|
|
|
|
|
|
} |
2187
|
|
|
|
|
|
|
# String => '\s*\}?\s*/' |
2188
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2189
|
|
|
|
|
|
|
# context => '#pop' |
2190
|
|
|
|
|
|
|
# endRegion => 'Block' |
2191
|
|
|
|
|
|
|
# type => 'RegExpr' |
2192
|
1114
|
50
|
|
|
|
2759
|
if ($self->testRegExpr($text, '\\s*\\}?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
2193
|
0
|
|
|
|
|
0
|
return 1 |
2194
|
|
|
|
|
|
|
} |
2195
|
|
|
|
|
|
|
# String => '\s*\)?\s*/' |
2196
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2197
|
|
|
|
|
|
|
# context => '#pop' |
2198
|
|
|
|
|
|
|
# type => 'RegExpr' |
2199
|
1114
|
50
|
|
|
|
2563
|
if ($self->testRegExpr($text, '\\s*\\)?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
2200
|
0
|
|
|
|
|
0
|
return 1 |
2201
|
|
|
|
|
|
|
} |
2202
|
|
|
|
|
|
|
# String => 'keywords' |
2203
|
|
|
|
|
|
|
# attribute => 'Keyword' |
2204
|
|
|
|
|
|
|
# context => '#pop' |
2205
|
|
|
|
|
|
|
# type => 'keyword' |
2206
|
1114
|
50
|
|
|
|
2886
|
if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#pop', 'Keyword')) { |
2207
|
0
|
|
|
|
|
0
|
return 1 |
2208
|
|
|
|
|
|
|
} |
2209
|
1114
|
|
|
|
|
2442
|
return 0; |
2210
|
|
|
|
|
|
|
}; |
2211
|
|
|
|
|
|
|
|
2212
|
|
|
|
|
|
|
sub parsestring { |
2213
|
3143
|
|
|
3143
|
0
|
4633
|
my ($self, $text) = @_; |
2214
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
2215
|
3143
|
100
|
|
|
|
5983
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
2216
|
1133
|
|
|
|
|
2145
|
return 1 |
2217
|
|
|
|
|
|
|
} |
2218
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2219
|
|
|
|
|
|
|
# char => '\' |
2220
|
|
|
|
|
|
|
# char1 => ''' |
2221
|
|
|
|
|
|
|
# context => '#stay' |
2222
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2223
|
2010
|
100
|
|
|
|
4306
|
if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2224
|
2
|
|
|
|
|
7
|
return 1 |
2225
|
|
|
|
|
|
|
} |
2226
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2227
|
|
|
|
|
|
|
# char => '\' |
2228
|
|
|
|
|
|
|
# char1 => '\' |
2229
|
|
|
|
|
|
|
# context => '#stay' |
2230
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2231
|
2008
|
100
|
|
|
|
4066
|
if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2232
|
3
|
|
|
|
|
9
|
return 1 |
2233
|
|
|
|
|
|
|
} |
2234
|
|
|
|
|
|
|
# attribute => 'Operator' |
2235
|
|
|
|
|
|
|
# char => ''' |
2236
|
|
|
|
|
|
|
# context => '#pop' |
2237
|
|
|
|
|
|
|
# endRegion => 'String' |
2238
|
|
|
|
|
|
|
# type => 'DetectChar' |
2239
|
2005
|
100
|
|
|
|
4099
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Operator')) { |
2240
|
1103
|
|
|
|
|
2006
|
return 1 |
2241
|
|
|
|
|
|
|
} |
2242
|
902
|
|
|
|
|
1482
|
return 0; |
2243
|
|
|
|
|
|
|
}; |
2244
|
|
|
|
|
|
|
|
2245
|
|
|
|
|
|
|
sub parsestring_2 { |
2246
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2247
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
2248
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
2249
|
0
|
|
|
|
|
0
|
return 1 |
2250
|
|
|
|
|
|
|
} |
2251
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2252
|
|
|
|
|
|
|
# char => '\' |
2253
|
|
|
|
|
|
|
# char1 => ')' |
2254
|
|
|
|
|
|
|
# context => '#stay' |
2255
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2256
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2257
|
0
|
|
|
|
|
0
|
return 1 |
2258
|
|
|
|
|
|
|
} |
2259
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2260
|
|
|
|
|
|
|
# char => '\' |
2261
|
|
|
|
|
|
|
# char1 => '\' |
2262
|
|
|
|
|
|
|
# context => '#stay' |
2263
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2264
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2265
|
0
|
|
|
|
|
0
|
return 1 |
2266
|
|
|
|
|
|
|
} |
2267
|
|
|
|
|
|
|
# attribute => 'String' |
2268
|
|
|
|
|
|
|
# char => '(' |
2269
|
|
|
|
|
|
|
# char1 => ')' |
2270
|
|
|
|
|
|
|
# context => '#stay' |
2271
|
|
|
|
|
|
|
# type => 'RangeDetect' |
2272
|
0
|
0
|
|
|
|
0
|
if ($self->testRangeDetect($text, '(', ')', 0, 0, undef, 0, '#stay', 'String')) { |
2273
|
0
|
|
|
|
|
0
|
return 1 |
2274
|
|
|
|
|
|
|
} |
2275
|
|
|
|
|
|
|
# attribute => 'Operator' |
2276
|
|
|
|
|
|
|
# char => ')' |
2277
|
|
|
|
|
|
|
# context => '#pop#pop' |
2278
|
|
|
|
|
|
|
# endRegion => 'String' |
2279
|
|
|
|
|
|
|
# type => 'DetectChar' |
2280
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { |
2281
|
0
|
|
|
|
|
0
|
return 1 |
2282
|
|
|
|
|
|
|
} |
2283
|
0
|
|
|
|
|
0
|
return 0; |
2284
|
|
|
|
|
|
|
}; |
2285
|
|
|
|
|
|
|
|
2286
|
|
|
|
|
|
|
sub parsestring_3 { |
2287
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2288
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
2289
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
2290
|
0
|
|
|
|
|
0
|
return 1 |
2291
|
|
|
|
|
|
|
} |
2292
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2293
|
|
|
|
|
|
|
# char => '\' |
2294
|
|
|
|
|
|
|
# char1 => '}' |
2295
|
|
|
|
|
|
|
# context => '#stay' |
2296
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2297
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', '}', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2298
|
0
|
|
|
|
|
0
|
return 1 |
2299
|
|
|
|
|
|
|
} |
2300
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2301
|
|
|
|
|
|
|
# char => '\' |
2302
|
|
|
|
|
|
|
# char1 => '\' |
2303
|
|
|
|
|
|
|
# context => '#stay' |
2304
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2305
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2306
|
0
|
|
|
|
|
0
|
return 1 |
2307
|
|
|
|
|
|
|
} |
2308
|
|
|
|
|
|
|
# attribute => 'String' |
2309
|
|
|
|
|
|
|
# char => '{' |
2310
|
|
|
|
|
|
|
# char1 => '}' |
2311
|
|
|
|
|
|
|
# context => '#stay' |
2312
|
|
|
|
|
|
|
# type => 'RangeDetect' |
2313
|
0
|
0
|
|
|
|
0
|
if ($self->testRangeDetect($text, '{', '}', 0, 0, undef, 0, '#stay', 'String')) { |
2314
|
0
|
|
|
|
|
0
|
return 1 |
2315
|
|
|
|
|
|
|
} |
2316
|
|
|
|
|
|
|
# attribute => 'Operator' |
2317
|
|
|
|
|
|
|
# char => '}' |
2318
|
|
|
|
|
|
|
# context => '#pop#pop' |
2319
|
|
|
|
|
|
|
# endRegion => 'String' |
2320
|
|
|
|
|
|
|
# type => 'DetectChar' |
2321
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { |
2322
|
0
|
|
|
|
|
0
|
return 1 |
2323
|
|
|
|
|
|
|
} |
2324
|
0
|
|
|
|
|
0
|
return 0; |
2325
|
|
|
|
|
|
|
}; |
2326
|
|
|
|
|
|
|
|
2327
|
|
|
|
|
|
|
sub parsestring_4 { |
2328
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2329
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
2330
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
2331
|
0
|
|
|
|
|
0
|
return 1 |
2332
|
|
|
|
|
|
|
} |
2333
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2334
|
|
|
|
|
|
|
# char => '\' |
2335
|
|
|
|
|
|
|
# char1 => ']' |
2336
|
|
|
|
|
|
|
# context => '#stay' |
2337
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2338
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2339
|
0
|
|
|
|
|
0
|
return 1 |
2340
|
|
|
|
|
|
|
} |
2341
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2342
|
|
|
|
|
|
|
# char => '\' |
2343
|
|
|
|
|
|
|
# char1 => '\' |
2344
|
|
|
|
|
|
|
# context => '#stay' |
2345
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2346
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2347
|
0
|
|
|
|
|
0
|
return 1 |
2348
|
|
|
|
|
|
|
} |
2349
|
|
|
|
|
|
|
# attribute => 'String' |
2350
|
|
|
|
|
|
|
# char => '[' |
2351
|
|
|
|
|
|
|
# char1 => ']' |
2352
|
|
|
|
|
|
|
# context => '#stay' |
2353
|
|
|
|
|
|
|
# type => 'RangeDetect' |
2354
|
0
|
0
|
|
|
|
0
|
if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'String')) { |
2355
|
0
|
|
|
|
|
0
|
return 1 |
2356
|
|
|
|
|
|
|
} |
2357
|
|
|
|
|
|
|
# attribute => 'Operator' |
2358
|
|
|
|
|
|
|
# char => ']' |
2359
|
|
|
|
|
|
|
# context => '#pop#pop' |
2360
|
|
|
|
|
|
|
# endRegion => 'String' |
2361
|
|
|
|
|
|
|
# type => 'DetectChar' |
2362
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { |
2363
|
0
|
|
|
|
|
0
|
return 1 |
2364
|
|
|
|
|
|
|
} |
2365
|
0
|
|
|
|
|
0
|
return 0; |
2366
|
|
|
|
|
|
|
}; |
2367
|
|
|
|
|
|
|
|
2368
|
|
|
|
|
|
|
sub parsestring_5 { |
2369
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2370
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
2371
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
2372
|
0
|
|
|
|
|
0
|
return 1 |
2373
|
|
|
|
|
|
|
} |
2374
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2375
|
|
|
|
|
|
|
# char => '\' |
2376
|
|
|
|
|
|
|
# char1 => '<' |
2377
|
|
|
|
|
|
|
# context => '#stay' |
2378
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2379
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', '<', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2380
|
0
|
|
|
|
|
0
|
return 1 |
2381
|
|
|
|
|
|
|
} |
2382
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2383
|
|
|
|
|
|
|
# char => '\' |
2384
|
|
|
|
|
|
|
# char1 => '\' |
2385
|
|
|
|
|
|
|
# context => '#stay' |
2386
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2387
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2388
|
0
|
|
|
|
|
0
|
return 1 |
2389
|
|
|
|
|
|
|
} |
2390
|
|
|
|
|
|
|
# attribute => 'String' |
2391
|
|
|
|
|
|
|
# char => '\' |
2392
|
|
|
|
|
|
|
# char1 => '>' |
2393
|
|
|
|
|
|
|
# context => '#stay' |
2394
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2395
|
0
|
0
|
|
|
|
0
|
if ($self->testDetect2Chars($text, '\\', '>', 0, 0, 0, undef, 0, '#stay', 'String')) { |
2396
|
0
|
|
|
|
|
0
|
return 1 |
2397
|
|
|
|
|
|
|
} |
2398
|
|
|
|
|
|
|
# attribute => 'String' |
2399
|
|
|
|
|
|
|
# char => '<' |
2400
|
|
|
|
|
|
|
# char1 => '>' |
2401
|
|
|
|
|
|
|
# context => '#stay' |
2402
|
|
|
|
|
|
|
# type => 'RangeDetect' |
2403
|
0
|
0
|
|
|
|
0
|
if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'String')) { |
2404
|
0
|
|
|
|
|
0
|
return 1 |
2405
|
|
|
|
|
|
|
} |
2406
|
|
|
|
|
|
|
# attribute => 'Operator' |
2407
|
|
|
|
|
|
|
# char => '>' |
2408
|
|
|
|
|
|
|
# context => '#pop#pop' |
2409
|
|
|
|
|
|
|
# endRegion => 'String' |
2410
|
|
|
|
|
|
|
# type => 'DetectChar' |
2411
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) { |
2412
|
0
|
|
|
|
|
0
|
return 1 |
2413
|
|
|
|
|
|
|
} |
2414
|
0
|
|
|
|
|
0
|
return 0; |
2415
|
|
|
|
|
|
|
}; |
2416
|
|
|
|
|
|
|
|
2417
|
|
|
|
|
|
|
sub parsestring_6 { |
2418
|
16
|
|
|
16
|
0
|
39
|
my ($self, $text) = @_; |
2419
|
|
|
|
|
|
|
# type => 'DetectIdentifier' |
2420
|
16
|
100
|
|
|
|
36
|
if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { |
2421
|
2
|
|
|
|
|
8
|
return 1 |
2422
|
|
|
|
|
|
|
} |
2423
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2424
|
|
|
|
|
|
|
# char => '\' |
2425
|
|
|
|
|
|
|
# char1 => '\' |
2426
|
|
|
|
|
|
|
# context => '#stay' |
2427
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2428
|
14
|
50
|
|
|
|
36
|
if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) { |
2429
|
0
|
|
|
|
|
0
|
return 1 |
2430
|
|
|
|
|
|
|
} |
2431
|
|
|
|
|
|
|
# String => '\\%1' |
2432
|
|
|
|
|
|
|
# attribute => 'String Special Character' |
2433
|
|
|
|
|
|
|
# context => '#stay' |
2434
|
|
|
|
|
|
|
# dynamic => 'true' |
2435
|
|
|
|
|
|
|
# type => 'RegExpr' |
2436
|
14
|
50
|
|
|
|
34
|
if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'String Special Character')) { |
2437
|
0
|
|
|
|
|
0
|
return 1 |
2438
|
|
|
|
|
|
|
} |
2439
|
|
|
|
|
|
|
# attribute => 'Operator' |
2440
|
|
|
|
|
|
|
# char => '1' |
2441
|
|
|
|
|
|
|
# context => '#pop#pop' |
2442
|
|
|
|
|
|
|
# dynamic => 'true' |
2443
|
|
|
|
|
|
|
# endRegion => 'String' |
2444
|
|
|
|
|
|
|
# type => 'DetectChar' |
2445
|
14
|
100
|
|
|
|
42
|
if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop', 'Operator')) { |
2446
|
2
|
|
|
|
|
7
|
return 1 |
2447
|
|
|
|
|
|
|
} |
2448
|
12
|
|
|
|
|
24
|
return 0; |
2449
|
|
|
|
|
|
|
}; |
2450
|
|
|
|
|
|
|
|
2451
|
|
|
|
|
|
|
sub parsesub_arg_definition { |
2452
|
6
|
|
|
6
|
0
|
13
|
my ($self, $text) = @_; |
2453
|
|
|
|
|
|
|
# String => '*$@%' |
2454
|
|
|
|
|
|
|
# attribute => 'Data Type' |
2455
|
|
|
|
|
|
|
# context => '#stay' |
2456
|
|
|
|
|
|
|
# type => 'AnyChar' |
2457
|
6
|
100
|
|
|
|
18
|
if ($self->testAnyChar($text, '*$@%', 0, 0, undef, 0, '#stay', 'Data Type')) { |
2458
|
2
|
|
|
|
|
5
|
return 1 |
2459
|
|
|
|
|
|
|
} |
2460
|
|
|
|
|
|
|
# String => '&\[];' |
2461
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2462
|
|
|
|
|
|
|
# context => '#stay' |
2463
|
|
|
|
|
|
|
# type => 'AnyChar' |
2464
|
4
|
50
|
|
|
|
9
|
if ($self->testAnyChar($text, '&\\[];', 0, 0, undef, 0, '#stay', 'Normal Text')) { |
2465
|
0
|
|
|
|
|
0
|
return 1 |
2466
|
|
|
|
|
|
|
} |
2467
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2468
|
|
|
|
|
|
|
# char => ')' |
2469
|
|
|
|
|
|
|
# context => 'slash_safe_escape' |
2470
|
|
|
|
|
|
|
# type => 'DetectChar' |
2471
|
4
|
100
|
|
|
|
10
|
if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, 'slash_safe_escape', 'Normal Text')) { |
2472
|
2
|
|
|
|
|
6
|
return 1 |
2473
|
|
|
|
|
|
|
} |
2474
|
2
|
|
|
|
|
6
|
return 0; |
2475
|
|
|
|
|
|
|
}; |
2476
|
|
|
|
|
|
|
|
2477
|
|
|
|
|
|
|
sub parsesub_name_def { |
2478
|
184
|
|
|
184
|
0
|
311
|
my ($self, $text) = @_; |
2479
|
|
|
|
|
|
|
# String => '\w+' |
2480
|
|
|
|
|
|
|
# attribute => 'Function' |
2481
|
|
|
|
|
|
|
# context => '#stay' |
2482
|
|
|
|
|
|
|
# type => 'RegExpr' |
2483
|
184
|
100
|
|
|
|
444
|
if ($self->testRegExpr($text, '\\w+', 0, 0, 0, undef, 0, '#stay', 'Function')) { |
2484
|
92
|
|
|
|
|
196
|
return 1 |
2485
|
|
|
|
|
|
|
} |
2486
|
|
|
|
|
|
|
# String => '\$\S' |
2487
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2488
|
|
|
|
|
|
|
# context => 'find_variable' |
2489
|
|
|
|
|
|
|
# lookAhead => 'true' |
2490
|
|
|
|
|
|
|
# type => 'RegExpr' |
2491
|
92
|
50
|
|
|
|
270
|
if ($self->testRegExpr($text, '\\$\\S', 0, 0, 1, undef, 0, 'find_variable', 'Normal Text')) { |
2492
|
0
|
|
|
|
|
0
|
return 1 |
2493
|
|
|
|
|
|
|
} |
2494
|
|
|
|
|
|
|
# String => '\s*\(' |
2495
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2496
|
|
|
|
|
|
|
# context => 'sub_arg_definition' |
2497
|
|
|
|
|
|
|
# type => 'RegExpr' |
2498
|
92
|
100
|
|
|
|
296
|
if ($self->testRegExpr($text, '\\s*\\(', 0, 0, 0, undef, 0, 'sub_arg_definition', 'Normal Text')) { |
2499
|
2
|
|
|
|
|
5
|
return 1 |
2500
|
|
|
|
|
|
|
} |
2501
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2502
|
|
|
|
|
|
|
# char => ':' |
2503
|
|
|
|
|
|
|
# char1 => ':' |
2504
|
|
|
|
|
|
|
# context => '#stay' |
2505
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2506
|
90
|
100
|
|
|
|
263
|
if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
2507
|
5
|
|
|
|
|
9
|
return 1 |
2508
|
|
|
|
|
|
|
} |
2509
|
85
|
|
|
|
|
170
|
return 0; |
2510
|
|
|
|
|
|
|
}; |
2511
|
|
|
|
|
|
|
|
2512
|
|
|
|
|
|
|
sub parsesubst_bracket_pattern { |
2513
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2514
|
|
|
|
|
|
|
# String => '\s+#.*$' |
2515
|
|
|
|
|
|
|
# attribute => 'Comment' |
2516
|
|
|
|
|
|
|
# context => '#stay' |
2517
|
|
|
|
|
|
|
# type => 'RegExpr' |
2518
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
2519
|
0
|
|
|
|
|
0
|
return 1 |
2520
|
|
|
|
|
|
|
} |
2521
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
2522
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2523
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
2524
|
0
|
|
|
|
|
0
|
return 1 |
2525
|
|
|
|
|
|
|
} |
2526
|
|
|
|
|
|
|
# attribute => 'Operator' |
2527
|
|
|
|
|
|
|
# char => ']' |
2528
|
|
|
|
|
|
|
# context => 'subst_bracket_replace' |
2529
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
2530
|
|
|
|
|
|
|
# type => 'DetectChar' |
2531
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, 'subst_bracket_replace', 'Operator')) { |
2532
|
0
|
|
|
|
|
0
|
return 1 |
2533
|
|
|
|
|
|
|
} |
2534
|
0
|
|
|
|
|
0
|
return 0; |
2535
|
|
|
|
|
|
|
}; |
2536
|
|
|
|
|
|
|
|
2537
|
|
|
|
|
|
|
sub parsesubst_bracket_replace { |
2538
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2539
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
2540
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2541
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
2542
|
0
|
|
|
|
|
0
|
return 1 |
2543
|
|
|
|
|
|
|
} |
2544
|
|
|
|
|
|
|
# attribute => 'Operator' |
2545
|
|
|
|
|
|
|
# beginRegion => 'Replacement' |
2546
|
|
|
|
|
|
|
# char => '[' |
2547
|
|
|
|
|
|
|
# context => '#stay' |
2548
|
|
|
|
|
|
|
# type => 'DetectChar' |
2549
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Operator')) { |
2550
|
0
|
|
|
|
|
0
|
return 1 |
2551
|
|
|
|
|
|
|
} |
2552
|
|
|
|
|
|
|
# String => '\][cegimosx]*' |
2553
|
|
|
|
|
|
|
# attribute => 'Operator' |
2554
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
2555
|
|
|
|
|
|
|
# endRegion => 'Replacement' |
2556
|
|
|
|
|
|
|
# type => 'RegExpr' |
2557
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\][cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
2558
|
0
|
|
|
|
|
0
|
return 1 |
2559
|
|
|
|
|
|
|
} |
2560
|
0
|
|
|
|
|
0
|
return 0; |
2561
|
|
|
|
|
|
|
}; |
2562
|
|
|
|
|
|
|
|
2563
|
|
|
|
|
|
|
sub parsesubst_curlybrace_middle { |
2564
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2565
|
|
|
|
|
|
|
# String => '#.*$' |
2566
|
|
|
|
|
|
|
# attribute => 'Comment' |
2567
|
|
|
|
|
|
|
# context => '#stay' |
2568
|
|
|
|
|
|
|
# type => 'RegExpr' |
2569
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
2570
|
0
|
|
|
|
|
0
|
return 1 |
2571
|
|
|
|
|
|
|
} |
2572
|
|
|
|
|
|
|
# attribute => 'Operator' |
2573
|
|
|
|
|
|
|
# beginRegion => 'Replacement' |
2574
|
|
|
|
|
|
|
# char => '{' |
2575
|
|
|
|
|
|
|
# context => 'subst_curlybrace_replace' |
2576
|
|
|
|
|
|
|
# type => 'DetectChar' |
2577
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace', 'Operator')) { |
2578
|
0
|
|
|
|
|
0
|
return 1 |
2579
|
|
|
|
|
|
|
} |
2580
|
0
|
|
|
|
|
0
|
return 0; |
2581
|
|
|
|
|
|
|
}; |
2582
|
|
|
|
|
|
|
|
2583
|
|
|
|
|
|
|
sub parsesubst_curlybrace_pattern { |
2584
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2585
|
|
|
|
|
|
|
# String => '\s+#.*$' |
2586
|
|
|
|
|
|
|
# attribute => 'Comment' |
2587
|
|
|
|
|
|
|
# context => '#stay' |
2588
|
|
|
|
|
|
|
# type => 'RegExpr' |
2589
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
2590
|
0
|
|
|
|
|
0
|
return 1 |
2591
|
|
|
|
|
|
|
} |
2592
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
2593
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2594
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
2595
|
0
|
|
|
|
|
0
|
return 1 |
2596
|
|
|
|
|
|
|
} |
2597
|
|
|
|
|
|
|
# attribute => 'Operator' |
2598
|
|
|
|
|
|
|
# char => '}' |
2599
|
|
|
|
|
|
|
# context => 'subst_curlybrace_middle' |
2600
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
2601
|
|
|
|
|
|
|
# type => 'DetectChar' |
2602
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'subst_curlybrace_middle', 'Operator')) { |
2603
|
0
|
|
|
|
|
0
|
return 1 |
2604
|
|
|
|
|
|
|
} |
2605
|
0
|
|
|
|
|
0
|
return 0; |
2606
|
|
|
|
|
|
|
}; |
2607
|
|
|
|
|
|
|
|
2608
|
|
|
|
|
|
|
sub parsesubst_curlybrace_replace { |
2609
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2610
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
2611
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2612
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
2613
|
0
|
|
|
|
|
0
|
return 1 |
2614
|
|
|
|
|
|
|
} |
2615
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2616
|
|
|
|
|
|
|
# beginRegion => 'Block' |
2617
|
|
|
|
|
|
|
# char => '{' |
2618
|
|
|
|
|
|
|
# context => 'subst_curlybrace_replace_recursive' |
2619
|
|
|
|
|
|
|
# type => 'DetectChar' |
2620
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace_recursive', 'Normal Text')) { |
2621
|
0
|
|
|
|
|
0
|
return 1 |
2622
|
|
|
|
|
|
|
} |
2623
|
|
|
|
|
|
|
# String => '\}[cegimosx]*' |
2624
|
|
|
|
|
|
|
# attribute => 'Operator' |
2625
|
|
|
|
|
|
|
# context => '#pop#pop#pop#pop' |
2626
|
|
|
|
|
|
|
# endRegion => 'Replacement' |
2627
|
|
|
|
|
|
|
# type => 'RegExpr' |
2628
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\}[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop#pop', 'Operator')) { |
2629
|
0
|
|
|
|
|
0
|
return 1 |
2630
|
|
|
|
|
|
|
} |
2631
|
0
|
|
|
|
|
0
|
return 0; |
2632
|
|
|
|
|
|
|
}; |
2633
|
|
|
|
|
|
|
|
2634
|
|
|
|
|
|
|
sub parsesubst_curlybrace_replace_recursive { |
2635
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2636
|
|
|
|
|
|
|
# attribute => 'String (interpolated)' |
2637
|
|
|
|
|
|
|
# beginRegion => 'Block' |
2638
|
|
|
|
|
|
|
# char => '{' |
2639
|
|
|
|
|
|
|
# context => 'subst_curlybrace_replace_recursive' |
2640
|
|
|
|
|
|
|
# type => 'DetectChar' |
2641
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace_recursive', 'String (interpolated)')) { |
2642
|
0
|
|
|
|
|
0
|
return 1 |
2643
|
|
|
|
|
|
|
} |
2644
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2645
|
|
|
|
|
|
|
# char => '}' |
2646
|
|
|
|
|
|
|
# context => '#pop' |
2647
|
|
|
|
|
|
|
# endRegion => 'Block' |
2648
|
|
|
|
|
|
|
# type => 'DetectChar' |
2649
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) { |
2650
|
0
|
|
|
|
|
0
|
return 1 |
2651
|
|
|
|
|
|
|
} |
2652
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
2653
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2654
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
2655
|
0
|
|
|
|
|
0
|
return 1 |
2656
|
|
|
|
|
|
|
} |
2657
|
0
|
|
|
|
|
0
|
return 0; |
2658
|
|
|
|
|
|
|
}; |
2659
|
|
|
|
|
|
|
|
2660
|
|
|
|
|
|
|
sub parsesubst_paren_pattern { |
2661
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2662
|
|
|
|
|
|
|
# String => '\s+#.*$' |
2663
|
|
|
|
|
|
|
# attribute => 'Comment' |
2664
|
|
|
|
|
|
|
# context => '#stay' |
2665
|
|
|
|
|
|
|
# type => 'RegExpr' |
2666
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
2667
|
0
|
|
|
|
|
0
|
return 1 |
2668
|
|
|
|
|
|
|
} |
2669
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
2670
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2671
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
2672
|
0
|
|
|
|
|
0
|
return 1 |
2673
|
|
|
|
|
|
|
} |
2674
|
|
|
|
|
|
|
# attribute => 'Operator' |
2675
|
|
|
|
|
|
|
# char => '}' |
2676
|
|
|
|
|
|
|
# context => 'subst_paren_replace' |
2677
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
2678
|
|
|
|
|
|
|
# type => 'DetectChar' |
2679
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'subst_paren_replace', 'Operator')) { |
2680
|
0
|
|
|
|
|
0
|
return 1 |
2681
|
|
|
|
|
|
|
} |
2682
|
0
|
|
|
|
|
0
|
return 0; |
2683
|
|
|
|
|
|
|
}; |
2684
|
|
|
|
|
|
|
|
2685
|
|
|
|
|
|
|
sub parsesubst_paren_replace { |
2686
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2687
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
2688
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2689
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('ipstring_internal', $text)) { |
2690
|
0
|
|
|
|
|
0
|
return 1 |
2691
|
|
|
|
|
|
|
} |
2692
|
|
|
|
|
|
|
# attribute => 'Operator' |
2693
|
|
|
|
|
|
|
# beginRegion => 'Replacement' |
2694
|
|
|
|
|
|
|
# char => '(' |
2695
|
|
|
|
|
|
|
# context => '#stay' |
2696
|
|
|
|
|
|
|
# type => 'DetectChar' |
2697
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Operator')) { |
2698
|
0
|
|
|
|
|
0
|
return 1 |
2699
|
|
|
|
|
|
|
} |
2700
|
|
|
|
|
|
|
# String => '\)[cegimosx]*' |
2701
|
|
|
|
|
|
|
# attribute => 'Operator' |
2702
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
2703
|
|
|
|
|
|
|
# endRegion => 'Replacement' |
2704
|
|
|
|
|
|
|
# type => 'RegExpr' |
2705
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\)[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
2706
|
0
|
|
|
|
|
0
|
return 1 |
2707
|
|
|
|
|
|
|
} |
2708
|
0
|
|
|
|
|
0
|
return 0; |
2709
|
|
|
|
|
|
|
}; |
2710
|
|
|
|
|
|
|
|
2711
|
|
|
|
|
|
|
sub parsesubst_slash_pattern { |
2712
|
103
|
|
|
103
|
0
|
165
|
my ($self, $text) = @_; |
2713
|
|
|
|
|
|
|
# String => '\$(?=%1)' |
2714
|
|
|
|
|
|
|
# attribute => 'Pattern Internal Operator' |
2715
|
|
|
|
|
|
|
# context => '#stay' |
2716
|
|
|
|
|
|
|
# dynamic => 'true' |
2717
|
|
|
|
|
|
|
# type => 'RegExpr' |
2718
|
103
|
100
|
|
|
|
233
|
if ($self->testRegExpr($text, '\\$(?=%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) { |
2719
|
1
|
|
|
|
|
3
|
return 1 |
2720
|
|
|
|
|
|
|
} |
2721
|
|
|
|
|
|
|
# String => '(%1)' |
2722
|
|
|
|
|
|
|
# attribute => 'Operator' |
2723
|
|
|
|
|
|
|
# beginRegion => 'Replacement' |
2724
|
|
|
|
|
|
|
# context => 'subst_slash_replace' |
2725
|
|
|
|
|
|
|
# dynamic => 'true' |
2726
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
2727
|
|
|
|
|
|
|
# type => 'RegExpr' |
2728
|
102
|
100
|
|
|
|
274
|
if ($self->testRegExpr($text, '(%1)', 0, 1, 0, undef, 0, 'subst_slash_replace', 'Operator')) { |
2729
|
26
|
|
|
|
|
58
|
return 1 |
2730
|
|
|
|
|
|
|
} |
2731
|
|
|
|
|
|
|
# context => 'regex_pattern_internal_ip' |
2732
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2733
|
76
|
100
|
|
|
|
179
|
if ($self->includeRules('regex_pattern_internal_ip', $text)) { |
2734
|
47
|
|
|
|
|
82
|
return 1 |
2735
|
|
|
|
|
|
|
} |
2736
|
29
|
|
|
|
|
54
|
return 0; |
2737
|
|
|
|
|
|
|
}; |
2738
|
|
|
|
|
|
|
|
2739
|
|
|
|
|
|
|
sub parsesubst_slash_replace { |
2740
|
44
|
|
|
44
|
0
|
82
|
my ($self, $text) = @_; |
2741
|
|
|
|
|
|
|
# context => 'ipstring_internal' |
2742
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2743
|
44
|
100
|
|
|
|
102
|
if ($self->includeRules('ipstring_internal', $text)) { |
2744
|
12
|
|
|
|
|
33
|
return 1 |
2745
|
|
|
|
|
|
|
} |
2746
|
|
|
|
|
|
|
# String => '%1[cegimosx]*' |
2747
|
|
|
|
|
|
|
# attribute => 'Operator' |
2748
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
2749
|
|
|
|
|
|
|
# dynamic => 'true' |
2750
|
|
|
|
|
|
|
# endRegion => 'Replacement' |
2751
|
|
|
|
|
|
|
# type => 'RegExpr' |
2752
|
32
|
100
|
|
|
|
92
|
if ($self->testRegExpr($text, '%1[cegimosx]*', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
2753
|
26
|
|
|
|
|
57
|
return 1 |
2754
|
|
|
|
|
|
|
} |
2755
|
6
|
|
|
|
|
12
|
return 0; |
2756
|
|
|
|
|
|
|
}; |
2757
|
|
|
|
|
|
|
|
2758
|
|
|
|
|
|
|
sub parsesubst_sq_pattern { |
2759
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2760
|
|
|
|
|
|
|
# String => '\s+#.*$' |
2761
|
|
|
|
|
|
|
# attribute => 'Comment' |
2762
|
|
|
|
|
|
|
# context => '#stay' |
2763
|
|
|
|
|
|
|
# type => 'RegExpr' |
2764
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) { |
2765
|
0
|
|
|
|
|
0
|
return 1 |
2766
|
|
|
|
|
|
|
} |
2767
|
|
|
|
|
|
|
# context => 'regex_pattern_internal' |
2768
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2769
|
0
|
0
|
|
|
|
0
|
if ($self->includeRules('regex_pattern_internal', $text)) { |
2770
|
0
|
|
|
|
|
0
|
return 1 |
2771
|
|
|
|
|
|
|
} |
2772
|
|
|
|
|
|
|
# attribute => 'Operator' |
2773
|
|
|
|
|
|
|
# beginRegion => 'Pattern' |
2774
|
|
|
|
|
|
|
# char => ''' |
2775
|
|
|
|
|
|
|
# context => 'subst_sq_replace' |
2776
|
|
|
|
|
|
|
# endRegion => 'Pattern' |
2777
|
|
|
|
|
|
|
# type => 'DetectChar' |
2778
|
0
|
0
|
|
|
|
0
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'subst_sq_replace', 'Operator')) { |
2779
|
0
|
|
|
|
|
0
|
return 1 |
2780
|
|
|
|
|
|
|
} |
2781
|
0
|
|
|
|
|
0
|
return 0; |
2782
|
|
|
|
|
|
|
}; |
2783
|
|
|
|
|
|
|
|
2784
|
|
|
|
|
|
|
sub parsesubst_sq_replace { |
2785
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2786
|
|
|
|
|
|
|
# String => ''[cegimosx]*' |
2787
|
|
|
|
|
|
|
# attribute => 'Operator' |
2788
|
|
|
|
|
|
|
# context => '#pop#pop#pop' |
2789
|
|
|
|
|
|
|
# endRegion => 'Replacement' |
2790
|
|
|
|
|
|
|
# type => 'RegExpr' |
2791
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\'[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) { |
2792
|
0
|
|
|
|
|
0
|
return 1 |
2793
|
|
|
|
|
|
|
} |
2794
|
0
|
|
|
|
|
0
|
return 0; |
2795
|
|
|
|
|
|
|
}; |
2796
|
|
|
|
|
|
|
|
2797
|
|
|
|
|
|
|
sub parsetr { |
2798
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
2799
|
|
|
|
|
|
|
# String => '\([^)]*\)\s*\(?:[^)]*\)' |
2800
|
|
|
|
|
|
|
# attribute => 'Pattern' |
2801
|
|
|
|
|
|
|
# context => '#pop' |
2802
|
|
|
|
|
|
|
# type => 'RegExpr' |
2803
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\([^)]*\\)\\s*\\(?:[^)]*\\)', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { |
2804
|
0
|
|
|
|
|
0
|
return 1 |
2805
|
|
|
|
|
|
|
} |
2806
|
|
|
|
|
|
|
# String => '\{[^}]*\}\s*\{[^}]*\}' |
2807
|
|
|
|
|
|
|
# attribute => 'Pattern' |
2808
|
|
|
|
|
|
|
# context => '#pop' |
2809
|
|
|
|
|
|
|
# type => 'RegExpr' |
2810
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\{[^}]*\\}\\s*\\{[^}]*\\}', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { |
2811
|
0
|
|
|
|
|
0
|
return 1 |
2812
|
|
|
|
|
|
|
} |
2813
|
|
|
|
|
|
|
# String => '\[[^}]*\]\s*\[[^\]]*\]' |
2814
|
|
|
|
|
|
|
# attribute => 'Pattern' |
2815
|
|
|
|
|
|
|
# context => '#pop' |
2816
|
|
|
|
|
|
|
# type => 'RegExpr' |
2817
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '\\[[^}]*\\]\\s*\\[[^\\]]*\\]', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { |
2818
|
0
|
|
|
|
|
0
|
return 1 |
2819
|
|
|
|
|
|
|
} |
2820
|
|
|
|
|
|
|
# String => '([^a-zA-Z0-9_\s[\]{}()]).*\1.*\1' |
2821
|
|
|
|
|
|
|
# attribute => 'Pattern' |
2822
|
|
|
|
|
|
|
# context => '#pop' |
2823
|
|
|
|
|
|
|
# minimal => 'true' |
2824
|
|
|
|
|
|
|
# type => 'RegExpr' |
2825
|
0
|
0
|
|
|
|
0
|
if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()]).*?\\1.*?\\1', 0, 0, 0, undef, 0, '#pop', 'Pattern')) { |
2826
|
0
|
|
|
|
|
0
|
return 1 |
2827
|
|
|
|
|
|
|
} |
2828
|
0
|
|
|
|
|
0
|
return 0; |
2829
|
|
|
|
|
|
|
}; |
2830
|
|
|
|
|
|
|
|
2831
|
|
|
|
|
|
|
sub parsevar_detect { |
2832
|
2493
|
|
|
2493
|
0
|
3646
|
my ($self, $text) = @_; |
2833
|
|
|
|
|
|
|
# context => 'var_detect_rules' |
2834
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2835
|
2493
|
100
|
|
|
|
4609
|
if ($self->includeRules('var_detect_rules', $text)) { |
2836
|
1433
|
|
|
|
|
2526
|
return 1 |
2837
|
|
|
|
|
|
|
} |
2838
|
|
|
|
|
|
|
# context => 'slash_safe_escape' |
2839
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2840
|
1060
|
100
|
|
|
|
1964
|
if ($self->includeRules('slash_safe_escape', $text)) { |
2841
|
2
|
|
|
|
|
5
|
return 1 |
2842
|
|
|
|
|
|
|
} |
2843
|
1058
|
|
|
|
|
1911
|
return 0; |
2844
|
|
|
|
|
|
|
}; |
2845
|
|
|
|
|
|
|
|
2846
|
|
|
|
|
|
|
sub parsevar_detect_rules { |
2847
|
2554
|
|
|
2554
|
0
|
3745
|
my ($self, $text) = @_; |
2848
|
|
|
|
|
|
|
# String => '[\w_]+' |
2849
|
|
|
|
|
|
|
# attribute => 'Data Type' |
2850
|
|
|
|
|
|
|
# context => '#stay' |
2851
|
|
|
|
|
|
|
# type => 'RegExpr' |
2852
|
2554
|
100
|
|
|
|
4919
|
if ($self->testRegExpr($text, '[\\w_]+', 0, 0, 0, undef, 0, '#stay', 'Data Type')) { |
2853
|
1202
|
|
|
|
|
2801
|
return 1 |
2854
|
|
|
|
|
|
|
} |
2855
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2856
|
|
|
|
|
|
|
# char => ':' |
2857
|
|
|
|
|
|
|
# char1 => ':' |
2858
|
|
|
|
|
|
|
# context => '#stay' |
2859
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2860
|
1352
|
100
|
|
|
|
3192
|
if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
2861
|
1
|
|
|
|
|
3
|
return 1 |
2862
|
|
|
|
|
|
|
} |
2863
|
|
|
|
|
|
|
# attribute => 'Operator' |
2864
|
|
|
|
|
|
|
# char => ''' |
2865
|
|
|
|
|
|
|
# context => '#stay' |
2866
|
|
|
|
|
|
|
# type => 'DetectChar' |
2867
|
1351
|
100
|
|
|
|
2919
|
if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#stay', 'Operator')) { |
2868
|
7
|
|
|
|
|
27
|
return 1 |
2869
|
|
|
|
|
|
|
} |
2870
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2871
|
|
|
|
|
|
|
# char => '-' |
2872
|
|
|
|
|
|
|
# char1 => '>' |
2873
|
|
|
|
|
|
|
# context => '#stay' |
2874
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2875
|
1344
|
100
|
|
|
|
2729
|
if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
2876
|
256
|
|
|
|
|
566
|
return 1 |
2877
|
|
|
|
|
|
|
} |
2878
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2879
|
|
|
|
|
|
|
# char => '+' |
2880
|
|
|
|
|
|
|
# char1 => '+' |
2881
|
|
|
|
|
|
|
# context => '#stay' |
2882
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2883
|
1088
|
50
|
|
|
|
2196
|
if ($self->testDetect2Chars($text, '+', '+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
2884
|
0
|
|
|
|
|
0
|
return 1 |
2885
|
|
|
|
|
|
|
} |
2886
|
|
|
|
|
|
|
# attribute => 'Normal Text' |
2887
|
|
|
|
|
|
|
# char => '-' |
2888
|
|
|
|
|
|
|
# char1 => '-' |
2889
|
|
|
|
|
|
|
# context => '#stay' |
2890
|
|
|
|
|
|
|
# type => 'Detect2Chars' |
2891
|
1088
|
50
|
|
|
|
2141
|
if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
2892
|
0
|
|
|
|
|
0
|
return 1 |
2893
|
|
|
|
|
|
|
} |
2894
|
1088
|
|
|
|
|
2234
|
return 0; |
2895
|
|
|
|
|
|
|
}; |
2896
|
|
|
|
|
|
|
|
2897
|
|
|
|
|
|
|
sub parsevar_detect_unsafe { |
2898
|
61
|
|
|
61
|
0
|
88
|
my ($self, $text) = @_; |
2899
|
|
|
|
|
|
|
# context => 'var_detect_rules' |
2900
|
|
|
|
|
|
|
# type => 'IncludeRules' |
2901
|
61
|
100
|
|
|
|
118
|
if ($self->includeRules('var_detect_rules', $text)) { |
2902
|
33
|
|
|
|
|
62
|
return 1 |
2903
|
|
|
|
|
|
|
} |
2904
|
28
|
|
|
|
|
50
|
return 0; |
2905
|
|
|
|
|
|
|
}; |
2906
|
|
|
|
|
|
|
|
2907
|
|
|
|
|
|
|
|
2908
|
|
|
|
|
|
|
1; |
2909
|
|
|
|
|
|
|
|
2910
|
|
|
|
|
|
|
__END__ |