Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Perl.pm
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.06';
16
17 use strict;
18 use warnings;
19 use base('Syntax::Highlight::Engine::Kate::Template');
20
21 sub new {
22    my $proto = shift;
23    my $class = ref($proto) || $proto;
24    my $self = $class->SUPER::new(@_);
25    $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    $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    $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    $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    $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    $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    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
619    $self->basecontext('normal');
620    $self->keywordscase(0);
621    $self->initialize;
622    bless ($self, $class);
623    return $self;
624 }
625
626 sub language {
627    return 'Perl';
628 }
629
630 sub parseBackticked {
631    my ($self, $text) = @_;
632    # context => 'ipstring_internal'
633    # type => 'IncludeRules'
634    if ($self->includeRules('ipstring_internal', $text)) {
635       return 1
636    }
637    # attribute => 'Operator'
638    # char => '`'
639    # context => '#pop'
640    # type => 'DetectChar'
641    if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
642       return 1
643    }
644    return 0;
645 };
646
647 sub parsecomment {
648    my ($self, $text) = @_;
649    # type => 'DetectSpaces'
650    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
651       return 1
652    }
653    # context => '##Alerts'
654    # type => 'IncludeRules'
655    if ($self->includePlugin('Alerts', $text)) {
656       return 1
657    }
658    # type => 'DetectIdentifier'
659    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
660       return 1
661    }
662    return 0;
663 };
664
665 sub parsedata_handle {
666    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    if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s+.*', 0, 0, 0, 0, 0, 'pod', 'Pod')) {
674       return 1
675    }
676    # String => '__END__'
677    # attribute => 'Keyword'
678    # context => 'normal'
679    # firstNonSpace => 'true'
680    # type => 'StringDetect'
681    if ($self->testStringDetect($text, '__END__', 0, 0, 0, undef, 1, 'normal', 'Keyword')) {
682       return 1
683    }
684    return 0;
685 };
686
687 sub parseend_handle {
688    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    if ($self->testRegExpr($text, '^\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s*.*', 0, 0, 0, undef, 0, 'pod', 'Pod')) {
694       return 1
695    }
696    # String => '__DATA__'
697    # attribute => 'Keyword'
698    # context => 'data_handle'
699    # firstNonSpace => 'true'
700    # type => 'StringDetect'
701    if ($self->testStringDetect($text, '__DATA__', 0, 0, 0, undef, 1, 'data_handle', 'Keyword')) {
702       return 1
703    }
704    return 0;
705 };
706
707 sub parsefind_here_document {
708    my ($self, $text) = @_;
709    # String => '(\w+)\s*;?'
710    # attribute => 'Keyword'
711    # context => 'here_document'
712    # type => 'RegExpr'
713    if ($self->testRegExpr($text, '(\\w+)\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) {
714       return 1
715    }
716    # String => '\s*"([^"]+)"\s*;?'
717    # attribute => 'Keyword'
718    # context => 'here_document'
719    # type => 'RegExpr'
720    if ($self->testRegExpr($text, '\\s*"([^"]+)"\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) {
721       return 1
722    }
723    # String => '\s*`([^`]+)`\s*;?'
724    # attribute => 'Keyword'
725    # context => 'here_document'
726    # type => 'RegExpr'
727    if ($self->testRegExpr($text, '\\s*`([^`]+)`\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) {
728       return 1
729    }
730    # String => '\s*'([^']+)'\s*;?'
731    # attribute => 'Keyword'
732    # context => 'here_document_dumb'
733    # type => 'RegExpr'
734    if ($self->testRegExpr($text, '\\s*\'([^\']+)\'\\s*;?', 0, 0, 0, undef, 0, 'here_document_dumb', 'Keyword')) {
735       return 1
736    }
737    return 0;
738 };
739
740 sub parsefind_pattern {
741    my ($self, $text) = @_;
742    # String => '\s+#.*'
743    # attribute => 'Comment'
744    # context => '#stay'
745    # type => 'RegExpr'
746    if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
747       return 1
748    }
749    # attribute => 'Operator'
750    # beginRegion => 'Pattern'
751    # char => '{'
752    # context => 'pattern_brace'
753    # type => 'DetectChar'
754    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'pattern_brace', 'Operator')) {
755       return 1
756    }
757    # attribute => 'Operator'
758    # beginRegion => 'Pattern'
759    # char => '('
760    # context => 'pattern_paren'
761    # type => 'DetectChar'
762    if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'pattern_paren', 'Operator')) {
763       return 1
764    }
765    # attribute => 'Operator'
766    # beginRegion => 'Pattern'
767    # char => '['
768    # context => 'pattern_bracket'
769    # type => 'DetectChar'
770    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'pattern_bracket', 'Operator')) {
771       return 1
772    }
773    # attribute => 'Operator'
774    # beginRegion => 'Pattern'
775    # char => '''
776    # context => 'pattern_sq'
777    # type => 'DetectChar'
778    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'pattern_sq', 'Operator')) {
779       return 1
780    }
781    # String => '([^\w\s])'
782    # attribute => 'Operator'
783    # beginRegion => 'Pattern'
784    # context => 'pattern'
785    # type => 'RegExpr'
786    if ($self->testRegExpr($text, '([^\\w\\s])', 0, 0, 0, undef, 0, 'pattern', 'Operator')) {
787       return 1
788    }
789    return 0;
790 };
791
792 sub parsefind_qqx {
793    my ($self, $text) = @_;
794    # attribute => 'Operator'
795    # beginRegion => 'String'
796    # char => '('
797    # context => 'ip_string_2'
798    # type => 'DetectChar'
799    if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ip_string_2', 'Operator')) {
800       return 1
801    }
802    # attribute => 'Operator'
803    # beginRegion => 'String'
804    # char => '{'
805    # context => 'ip_string_3'
806    # type => 'DetectChar'
807    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'ip_string_3', 'Operator')) {
808       return 1
809    }
810    # attribute => 'Operator'
811    # beginRegion => 'String'
812    # char => '['
813    # context => 'ip_string_4'
814    # type => 'DetectChar'
815    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'ip_string_4', 'Operator')) {
816       return 1
817    }
818    # attribute => 'Operator'
819    # beginRegion => 'String'
820    # char => '<'
821    # context => 'ip_string_5'
822    # type => 'DetectChar'
823    if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'ip_string_5', 'Operator')) {
824       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    if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'ip_string_6', 'Operator')) {
832       return 1
833    }
834    # String => '\s+#.*'
835    # attribute => 'Comment'
836    # context => '#stay'
837    # type => 'RegExpr'
838    if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
839       return 1
840    }
841    return 0;
842 };
843
844 sub parsefind_quoted {
845    my ($self, $text) = @_;
846    # String => 'x\s*(')'
847    # attribute => 'Operator'
848    # beginRegion => 'String'
849    # context => 'string_6'
850    # type => 'RegExpr'
851    if ($self->testRegExpr($text, 'x\\s*(\')', 0, 0, 0, undef, 0, 'string_6', 'Operator')) {
852       return 1
853    }
854    # String => 'qx'
855    # attribute => 'Operator'
856    # context => 'find_qqx'
857    # type => 'AnyChar'
858    if ($self->testAnyChar($text, 'qx', 0, 0, undef, 0, 'find_qqx', 'Operator')) {
859       return 1
860    }
861    # attribute => 'Operator'
862    # char => 'w'
863    # context => 'find_qw'
864    # type => 'DetectChar'
865    if ($self->testDetectChar($text, 'w', 0, 0, 0, undef, 0, 'find_qw', 'Operator')) {
866       return 1
867    }
868    # attribute => 'Operator'
869    # beginRegion => 'String'
870    # char => '('
871    # context => 'string_2'
872    # type => 'DetectChar'
873    if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'string_2', 'Operator')) {
874       return 1
875    }
876    # attribute => 'Operator'
877    # beginRegion => 'String'
878    # char => '{'
879    # context => 'string_3'
880    # type => 'DetectChar'
881    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'string_3', 'Operator')) {
882       return 1
883    }
884    # attribute => 'Operator'
885    # beginRegion => 'String'
886    # char => '['
887    # context => 'string_4'
888    # type => 'DetectChar'
889    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'string_4', 'Operator')) {
890       return 1
891    }
892    # attribute => 'Operator'
893    # beginRegion => 'String'
894    # char => '<'
895    # context => 'string_5'
896    # type => 'DetectChar'
897    if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'string_5', 'Operator')) {
898       return 1
899    }
900    # String => '([^a-zA-Z0-9_\s[\]{}()])'
901    # attribute => 'Operator'
902    # beginRegion => 'String'
903    # context => 'string_6'
904    # type => 'RegExpr'
905    if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'string_6', 'Operator')) {
906       return 1
907    }
908    # String => '\s+#.*'
909    # attribute => 'Comment'
910    # context => '#stay'
911    # type => 'RegExpr'
912    if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
913       return 1
914    }
915    return 0;
916 };
917
918 sub parsefind_qw {
919    my ($self, $text) = @_;
920    # attribute => 'Operator'
921    # beginRegion => 'Wordlist'
922    # char => '('
923    # context => 'quote_word_paren'
924    # type => 'DetectChar'
925    if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'quote_word_paren', 'Operator')) {
926       return 1
927    }
928    # attribute => 'Operator'
929    # beginRegion => 'Wordlist'
930    # char => '{'
931    # context => 'quote_word_brace'
932    # type => 'DetectChar'
933    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'quote_word_brace', 'Operator')) {
934       return 1
935    }
936    # attribute => 'Operator'
937    # beginRegion => 'Wordlist'
938    # char => '['
939    # context => 'quote_word_bracket'
940    # type => 'DetectChar'
941    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'quote_word_bracket', 'Operator')) {
942       return 1
943    }
944    # String => '([^a-zA-Z0-9_\s[\]{}()])'
945    # attribute => 'Operator'
946    # beginRegion => 'Wordlist'
947    # context => 'quote_word'
948    # type => 'RegExpr'
949    if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'quote_word', 'Operator')) {
950       return 1
951    }
952    # String => '\s+#.*'
953    # attribute => 'Comment'
954    # context => '#stay'
955    # type => 'RegExpr'
956    if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
957       return 1
958    }
959    return 0;
960 };
961
962 sub parsefind_subst {
963    my ($self, $text) = @_;
964    # String => '\s+#.*'
965    # attribute => 'Comment'
966    # context => '#stay'
967    # type => 'RegExpr'
968    if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
969       return 1
970    }
971    # attribute => 'Operator'
972    # beginRegion => 'Pattern'
973    # char => '{'
974    # context => 'subst_curlybrace_pattern'
975    # type => 'DetectChar'
976    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_pattern', 'Operator')) {
977       return 1
978    }
979    # attribute => 'Operator'
980    # beginRegion => 'Pattern'
981    # char => '('
982    # context => 'subst_paren_pattern'
983    # type => 'DetectChar'
984    if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'subst_paren_pattern', 'Operator')) {
985       return 1
986    }
987    # attribute => 'Operator'
988    # beginRegion => 'Pattern'
989    # char => '['
990    # context => 'subst_bracket_pattern'
991    # type => 'DetectChar'
992    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'subst_bracket_pattern', 'Operator')) {
993       return 1
994    }
995    # attribute => 'Operator'
996    # beginRegion => 'Pattern'
997    # char => '''
998    # context => 'subst_sq_pattern'
999    # type => 'DetectChar'
1000    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'subst_sq_pattern', 'Operator')) {
1001       return 1
1002    }
1003    # String => '([^\w\s[\]{}()])'
1004    # attribute => 'Operator'
1005    # beginRegion => 'Pattern'
1006    # context => 'subst_slash_pattern'
1007    # type => 'RegExpr'
1008    if ($self->testRegExpr($text, '([^\\w\\s[\\]{}()])', 0, 0, 0, undef, 0, 'subst_slash_pattern', 'Operator')) {
1009       return 1
1010    }
1011    return 0;
1012 };
1013
1014 sub parsefind_variable {
1015    my ($self, $text) = @_;
1016    # String => '\$[0-9]+'
1017    # attribute => 'Special Variable'
1018    # context => 'var_detect'
1019    # type => 'RegExpr'
1020    if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) {
1021       return 1
1022    }
1023    # String => '[@\$](?:[\+\-_]\B|ARGV\b|INC\b)'
1024    # attribute => 'Special Variable'
1025    # context => 'var_detect'
1026    # type => 'RegExpr'
1027    if ($self->testRegExpr($text, '[@\\$](?:[\\+\\-_]\\B|ARGV\\b|INC\\b)', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) {
1028       return 1
1029    }
1030    # String => '[%\$](?:INC\b|ENV\b|SIG\b)'
1031    # attribute => 'Special Variable'
1032    # context => 'var_detect'
1033    # type => 'RegExpr'
1034    if ($self->testRegExpr($text, '[%\\$](?:INC\\b|ENV\\b|SIG\\b)', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) {
1035       return 1
1036    }
1037    # String => '\$\$[\$\w_]'
1038    # attribute => 'Data Type'
1039    # context => 'var_detect'
1040    # type => 'RegExpr'
1041    if ($self->testRegExpr($text, '\\$\\$[\\$\\w_]', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1042       return 1
1043    }
1044    # String => '\$[#_][\w_]'
1045    # attribute => 'Data Type'
1046    # context => 'var_detect'
1047    # type => 'RegExpr'
1048    if ($self->testRegExpr($text, '\\$[#_][\\w_]', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1049       return 1
1050    }
1051    # String => '\$+::'
1052    # attribute => 'Data Type'
1053    # context => 'var_detect'
1054    # type => 'RegExpr'
1055    if ($self->testRegExpr($text, '\\$+::', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1056       return 1
1057    }
1058    # String => '\$[^a-zA-Z0-9\s{][A-Z]?'
1059    # attribute => 'Special Variable'
1060    # context => '#stay'
1061    # type => 'RegExpr'
1062    if ($self->testRegExpr($text, '\\$[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) {
1063       return 1
1064    }
1065    # String => '[\$@%]\{[\w_]+\}'
1066    # attribute => 'Data Type'
1067    # context => 'var_detect'
1068    # type => 'RegExpr'
1069    if ($self->testRegExpr($text, '[\\$@%]\\{[\\w_]+\\}', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1070       return 1
1071    }
1072    # String => '$@%'
1073    # attribute => 'Data Type'
1074    # context => 'var_detect'
1075    # type => 'AnyChar'
1076    if ($self->testAnyChar($text, '$@%', 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1077       return 1
1078    }
1079    # String => '\*[a-zA-Z_]+'
1080    # attribute => 'Data Type'
1081    # context => 'var_detect'
1082    # type => 'RegExpr'
1083    if ($self->testRegExpr($text, '\\*[a-zA-Z_]+', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1084       return 1
1085    }
1086    # String => '\*[^a-zA-Z0-9\s{][A-Z]?'
1087    # attribute => 'Special Variable'
1088    # context => '#stay'
1089    # type => 'RegExpr'
1090    if ($self->testRegExpr($text, '\\*[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) {
1091       return 1
1092    }
1093    # String => '$@%*'
1094    # attribute => 'Operator'
1095    # context => '#pop'
1096    # type => 'AnyChar'
1097    if ($self->testAnyChar($text, '$@%*', 0, 0, undef, 0, '#pop', 'Operator')) {
1098       return 1
1099    }
1100    return 0;
1101 };
1102
1103 sub parsefind_variable_unsafe {
1104    my ($self, $text) = @_;
1105    # String => '\$[0-9]+'
1106    # attribute => 'Special Variable'
1107    # context => 'var_detect_unsafe'
1108    # type => 'RegExpr'
1109    if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) {
1110       return 1
1111    }
1112    # String => '[@\$](?:[\+\-_]\B|ARGV\b|INC\b)'
1113    # attribute => 'Special Variable'
1114    # context => 'var_detect_unsafe'
1115    # type => 'RegExpr'
1116    if ($self->testRegExpr($text, '[@\\$](?:[\\+\\-_]\\B|ARGV\\b|INC\\b)', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) {
1117       return 1
1118    }
1119    # String => '[%\$](?:INC\b|ENV\b|SIG\b)'
1120    # attribute => 'Special Variable'
1121    # context => 'var_detect_unsafe'
1122    # type => 'RegExpr'
1123    if ($self->testRegExpr($text, '[%\\$](?:INC\\b|ENV\\b|SIG\\b)', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) {
1124       return 1
1125    }
1126    # String => '\$\$[\$\w_]'
1127    # attribute => 'Data Type'
1128    # context => 'var_detect_unsafe'
1129    # type => 'RegExpr'
1130    if ($self->testRegExpr($text, '\\$\\$[\\$\\w_]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1131       return 1
1132    }
1133    # String => '\$[#_][\w_]'
1134    # attribute => 'Data Type'
1135    # context => 'var_detect_unsafe'
1136    # type => 'RegExpr'
1137    if ($self->testRegExpr($text, '\\$[#_][\\w_]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1138       return 1
1139    }
1140    # String => '\$+::'
1141    # attribute => 'Data Type'
1142    # context => 'var_detect_unsafe'
1143    # type => 'RegExpr'
1144    if ($self->testRegExpr($text, '\\$+::', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1145       return 1
1146    }
1147    # String => '\$[^a-zA-Z0-9\s{][A-Z]?'
1148    # attribute => 'Special Variable'
1149    # context => '#stay'
1150    # type => 'RegExpr'
1151    if ($self->testRegExpr($text, '\\$[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) {
1152       return 1
1153    }
1154    # String => '[\$@%]\{[\w_]+\}'
1155    # attribute => 'Data Type'
1156    # context => 'var_detect_unsafe'
1157    # type => 'RegExpr'
1158    if ($self->testRegExpr($text, '[\\$@%]\\{[\\w_]+\\}', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1159       return 1
1160    }
1161    # String => '[\$@%]'
1162    # attribute => 'Data Type'
1163    # context => 'var_detect_unsafe'
1164    # type => 'RegExpr'
1165    if ($self->testRegExpr($text, '[\\$@%]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1166       return 1
1167    }
1168    # String => '\*\w+'
1169    # attribute => 'Data Type'
1170    # context => 'var_detect_unsafe'
1171    # type => 'RegExpr'
1172    if ($self->testRegExpr($text, '\\*\\w+', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1173       return 1
1174    }
1175    # String => '$@%*'
1176    # attribute => 'Operator'
1177    # context => '#pop'
1178    # type => 'AnyChar'
1179    if ($self->testAnyChar($text, '$@%*', 0, 0, undef, 0, '#pop', 'Operator')) {
1180       return 1
1181    }
1182    return 0;
1183 };
1184
1185 sub parsehere_document {
1186    my ($self, $text) = @_;
1187    # type => 'DetectSpaces'
1188    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1189       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    if ($self->testRegExpr($text, '%1', 0, 1, 0, 0, 0, '#pop#pop', 'Keyword')) {
1199       return 1
1200    }
1201    # String => '\=\s*<<\s*["']?([A-Z0-9_\-]+)["']?'
1202    # attribute => 'Keyword'
1203    # beginRegion => 'HEREDoc'
1204    # context => 'here_document'
1205    # type => 'RegExpr'
1206    if ($self->testRegExpr($text, '\\=\\s*<<\\s*["\']?([A-Z0-9_\\-]+)["\']?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) {
1207       return 1
1208    }
1209    # context => 'ipstring_internal'
1210    # type => 'IncludeRules'
1211    if ($self->includeRules('ipstring_internal', $text)) {
1212       return 1
1213    }
1214    return 0;
1215 };
1216
1217 sub parsehere_document_dumb {
1218    my ($self, $text) = @_;
1219    # type => 'DetectSpaces'
1220    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1221       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    if ($self->testRegExpr($text, '%1', 0, 1, 0, 0, 0, '#pop#pop', 'Keyword')) {
1231       return 1
1232    }
1233    # type => 'DetectIdentifier'
1234    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1235       return 1
1236    }
1237    return 0;
1238 };
1239
1240 sub parseip_string {
1241    my ($self, $text) = @_;
1242    # attribute => 'Operator'
1243    # char => '"'
1244    # context => '#pop'
1245    # endRegion => 'String'
1246    # type => 'DetectChar'
1247    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
1248       return 1
1249    }
1250    # context => 'ipstring_internal'
1251    # type => 'IncludeRules'
1252    if ($self->includeRules('ipstring_internal', $text)) {
1253       return 1
1254    }
1255    return 0;
1256 };
1257
1258 sub parseip_string_2 {
1259    my ($self, $text) = @_;
1260    # attribute => 'String (interpolated)'
1261    # char => '('
1262    # char1 => ')'
1263    # context => '#stay'
1264    # type => 'RangeDetect'
1265    if ($self->testRangeDetect($text, '(', ')', 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1266       return 1
1267    }
1268    # attribute => 'Operator'
1269    # char => ')'
1270    # context => '#pop#pop#pop'
1271    # endRegion => 'String'
1272    # type => 'DetectChar'
1273    if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1274       return 1
1275    }
1276    # context => 'ipstring_internal'
1277    # type => 'IncludeRules'
1278    if ($self->includeRules('ipstring_internal', $text)) {
1279       return 1
1280    }
1281    return 0;
1282 };
1283
1284 sub parseip_string_3 {
1285    my ($self, $text) = @_;
1286    # attribute => 'String (interpolated)'
1287    # char => '{'
1288    # char1 => '}'
1289    # context => '#stay'
1290    # type => 'RangeDetect'
1291    if ($self->testRangeDetect($text, '{', '}', 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1292       return 1
1293    }
1294    # attribute => 'Operator'
1295    # char => '}'
1296    # context => '#pop#pop#pop'
1297    # endRegion => 'String'
1298    # type => 'DetectChar'
1299    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1300       return 1
1301    }
1302    # context => 'ipstring_internal'
1303    # type => 'IncludeRules'
1304    if ($self->includeRules('ipstring_internal', $text)) {
1305       return 1
1306    }
1307    return 0;
1308 };
1309
1310 sub parseip_string_4 {
1311    my ($self, $text) = @_;
1312    # attribute => 'String (interpolated)'
1313    # char => '['
1314    # char1 => ']'
1315    # context => '#stay'
1316    # type => 'RangeDetect'
1317    if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1318       return 1
1319    }
1320    # attribute => 'Operator'
1321    # char => ']'
1322    # context => '#pop#pop#pop'
1323    # endRegion => 'String'
1324    # type => 'DetectChar'
1325    if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1326       return 1
1327    }
1328    # context => 'ipstring_internal'
1329    # type => 'IncludeRules'
1330    if ($self->includeRules('ipstring_internal', $text)) {
1331       return 1
1332    }
1333    return 0;
1334 };
1335
1336 sub parseip_string_5 {
1337    my ($self, $text) = @_;
1338    # attribute => 'String (interpolated)'
1339    # char => '<'
1340    # char1 => '>'
1341    # context => '#stay'
1342    # type => 'RangeDetect'
1343    if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1344       return 1
1345    }
1346    # attribute => 'Operator'
1347    # char => '>'
1348    # context => '#pop#pop#pop'
1349    # endRegion => 'String'
1350    # type => 'DetectChar'
1351    if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1352       return 1
1353    }
1354    # context => 'ipstring_internal'
1355    # type => 'IncludeRules'
1356    if ($self->includeRules('ipstring_internal', $text)) {
1357       return 1
1358    }
1359    return 0;
1360 };
1361
1362 sub parseip_string_6 {
1363    my ($self, $text) = @_;
1364    # String => '\\%1'
1365    # attribute => 'String (interpolated)'
1366    # context => '#stay'
1367    # dynamic => 'true'
1368    # type => 'RegExpr'
1369    if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'String (interpolated)')) {
1370       return 1
1371    }
1372    # attribute => 'Operator'
1373    # char => '1'
1374    # context => '#pop#pop#pop'
1375    # dynamic => 'true'
1376    # endRegion => 'String'
1377    # type => 'DetectChar'
1378    if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1379       return 1
1380    }
1381    # context => 'ipstring_internal'
1382    # type => 'IncludeRules'
1383    if ($self->includeRules('ipstring_internal', $text)) {
1384       return 1
1385    }
1386    return 0;
1387 };
1388
1389 sub parseipstring_internal {
1390    my ($self, $text) = @_;
1391    # type => 'DetectIdentifier'
1392    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1393       return 1
1394    }
1395    # String => '\\[UuLlEtnaefr]'
1396    # attribute => 'String Special Character'
1397    # context => '#stay'
1398    # type => 'RegExpr'
1399    if ($self->testRegExpr($text, '\\\\[UuLlEtnaefr]', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
1400       return 1
1401    }
1402    # String => '\\.'
1403    # attribute => 'String (interpolated)'
1404    # context => '#stay'
1405    # type => 'RegExpr'
1406    if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1407       return 1
1408    }
1409    # String => '(?:[\$@]\S|%[\w{])'
1410    # attribute => 'Normal Text'
1411    # context => 'find_variable_unsafe'
1412    # lookAhead => 'true'
1413    # type => 'RegExpr'
1414    if ($self->testRegExpr($text, '(?:[\\$@]\\S|%[\\w{])', 0, 0, 1, undef, 0, 'find_variable_unsafe', 'Normal Text')) {
1415       return 1
1416    }
1417    return 0;
1418 };
1419
1420 sub parsenormal {
1421    my ($self, $text) = @_;
1422    # String => '^#!\/.*'
1423    # attribute => 'Keyword'
1424    # context => '#stay'
1425    # type => 'RegExpr'
1426    if ($self->testRegExpr($text, '^#!\\/.*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1427       return 1
1428    }
1429    # String => '__DATA__'
1430    # attribute => 'Keyword'
1431    # context => 'data_handle'
1432    # firstNonSpace => 'true'
1433    # type => 'StringDetect'
1434    if ($self->testStringDetect($text, '__DATA__', 0, 0, 0, undef, 1, 'data_handle', 'Keyword')) {
1435       return 1
1436    }
1437    # String => '__END__'
1438    # attribute => 'Keyword'
1439    # context => '#stay'
1440    # firstNonSpace => 'true'
1441    # type => 'StringDetect'
1442    if ($self->testStringDetect($text, '__END__', 0, 0, 0, undef, 1, '#stay', 'Keyword')) {
1443       return 1
1444    }
1445    # String => '\bsub\s+'
1446    # attribute => 'Keyword'
1447    # context => 'sub_name_def'
1448    # type => 'RegExpr'
1449    if ($self->testRegExpr($text, '\\bsub\\s+', 0, 0, 0, undef, 0, 'sub_name_def', 'Keyword')) {
1450       return 1
1451    }
1452    # String => 'keywords'
1453    # attribute => 'Keyword'
1454    # context => '#stay'
1455    # type => 'keyword'
1456    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
1457       return 1
1458    }
1459    # String => 'operators'
1460    # attribute => 'Operator'
1461    # context => '#stay'
1462    # type => 'keyword'
1463    if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) {
1464       return 1
1465    }
1466    # String => 'functions'
1467    # attribute => 'Function'
1468    # context => '#stay'
1469    # type => 'keyword'
1470    if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
1471       return 1
1472    }
1473    # String => 'pragmas'
1474    # attribute => 'Pragma'
1475    # context => '#stay'
1476    # type => 'keyword'
1477    if ($self->testKeyword($text, 'pragmas', 0, undef, 0, '#stay', 'Pragma')) {
1478       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    if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)(\\s|$)', 0, 0, 0, 0, 0, 'pod', 'Pod')) {
1487       return 1
1488    }
1489    # type => 'DetectSpaces'
1490    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1491       return 1
1492    }
1493    # attribute => 'Comment'
1494    # char => '#'
1495    # context => 'comment'
1496    # type => 'DetectChar'
1497    if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
1498       return 1
1499    }
1500    # attribute => 'Octal'
1501    # context => 'slash_safe_escape'
1502    # type => 'HlCOct'
1503    if ($self->testHlCOct($text, 0, undef, 0, 'slash_safe_escape', 'Octal')) {
1504       return 1
1505    }
1506    # attribute => 'Hex'
1507    # context => 'slash_safe_escape'
1508    # type => 'HlCHex'
1509    if ($self->testHlCHex($text, 0, undef, 0, 'slash_safe_escape', 'Hex')) {
1510       return 1
1511    }
1512    # attribute => 'Float'
1513    # context => 'slash_safe_escape'
1514    # type => 'Float'
1515    if ($self->testFloat($text, 0, undef, 0, 'slash_safe_escape', 'Float')) {
1516       return 1
1517    }
1518    # attribute => 'Decimal'
1519    # context => 'slash_safe_escape'
1520    # type => 'Int'
1521    if ($self->testInt($text, 0, undef, 0, 'slash_safe_escape', 'Decimal')) {
1522       return 1
1523    }
1524    # String => '\\(["'])[^\1]'
1525    # attribute => 'Normal Text'
1526    # context => '#stay'
1527    # type => 'RegExpr'
1528    if ($self->testRegExpr($text, '\\\\(["\'])[^\\1]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1529       return 1
1530    }
1531    # attribute => 'Normal Text'
1532    # char => '&'
1533    # char1 => '''
1534    # context => '#stay'
1535    # type => 'Detect2Chars'
1536    if ($self->testDetect2Chars($text, '&', '\'', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1537       return 1
1538    }
1539    # attribute => 'Operator'
1540    # beginRegion => 'String'
1541    # char => '"'
1542    # context => 'ip_string'
1543    # type => 'DetectChar'
1544    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'ip_string', 'Operator')) {
1545       return 1
1546    }
1547    # attribute => 'Operator'
1548    # beginRegion => 'String'
1549    # char => '''
1550    # context => 'string'
1551    # type => 'DetectChar'
1552    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'string', 'Operator')) {
1553       return 1
1554    }
1555    # attribute => 'Operator'
1556    # char => '`'
1557    # context => 'Backticked'
1558    # type => 'DetectChar'
1559    if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Backticked', 'Operator')) {
1560       return 1
1561    }
1562    # String => '(?:[$@]\S|%[\w{]|\*[^\d\*{\$@%=(])'
1563    # attribute => 'Normal Text'
1564    # context => 'find_variable'
1565    # lookAhead => 'true'
1566    # type => 'RegExpr'
1567    if ($self->testRegExpr($text, '(?:[$@]\\S|%[\\w{]|\\*[^\\d\\*{\\$@%=(])', 0, 0, 1, undef, 0, 'find_variable', 'Normal Text')) {
1568       return 1
1569    }
1570    # String => '<[A-Z0-9_]+>'
1571    # attribute => 'Keyword'
1572    # context => '#stay'
1573    # type => 'RegExpr'
1574    if ($self->testRegExpr($text, '<[A-Z0-9_]+>', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1575       return 1
1576    }
1577    # String => '\s*<<(?=\w+|\s*["'])'
1578    # attribute => 'Operator'
1579    # beginRegion => 'HereDocument'
1580    # context => 'find_here_document'
1581    # type => 'RegExpr'
1582    if ($self->testRegExpr($text, '\\s*<<(?=\\w+|\\s*["\'])', 0, 0, 0, undef, 0, 'find_here_document', 'Operator')) {
1583       return 1
1584    }
1585    # String => '\s*\}\s*/'
1586    # attribute => 'Normal Text'
1587    # context => '#stay'
1588    # endRegion => 'Block'
1589    # type => 'RegExpr'
1590    if ($self->testRegExpr($text, '\\s*\\}\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1591       return 1
1592    }
1593    # String => '\s*[)]\s*/'
1594    # attribute => 'Normal Text'
1595    # context => '#stay'
1596    # type => 'RegExpr'
1597    if ($self->testRegExpr($text, '\\s*[)]\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1598       return 1
1599    }
1600    # String => '\w+::'
1601    # attribute => 'Function'
1602    # context => 'sub_name_def'
1603    # type => 'RegExpr'
1604    if ($self->testRegExpr($text, '\\w+::', 0, 0, 0, undef, 0, 'sub_name_def', 'Function')) {
1605       return 1
1606    }
1607    # String => '\w+[=]'
1608    # attribute => 'Normal Text'
1609    # context => '#stay'
1610    # type => 'RegExpr'
1611    if ($self->testRegExpr($text, '\\w+[=]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1612       return 1
1613    }
1614    # String => '\bq(?=[qwx]?\s*[^\w\s])'
1615    # attribute => 'Operator'
1616    # context => 'find_quoted'
1617    # type => 'RegExpr'
1618    if ($self->testRegExpr($text, '\\bq(?=[qwx]?\\s*[^\\w\\s])', 0, 0, 0, undef, 0, 'find_quoted', 'Operator')) {
1619       return 1
1620    }
1621    # String => '\bs(?=\s*[^\w\s])'
1622    # attribute => 'Operator'
1623    # context => 'find_subst'
1624    # type => 'RegExpr'
1625    if ($self->testRegExpr($text, '\\bs(?=\\s*[^\\w\\s])', 0, 0, 0, undef, 0, 'find_subst', 'Operator')) {
1626       return 1
1627    }
1628    # String => '\b(?:tr|y)\s*(?=[^\w\s\]})])'
1629    # attribute => 'Operator'
1630    # context => 'tr'
1631    # type => 'RegExpr'
1632    if ($self->testRegExpr($text, '\\b(?:tr|y)\\s*(?=[^\\w\\s\\]})])', 0, 0, 0, undef, 0, 'tr', 'Operator')) {
1633       return 1
1634    }
1635    # String => '\b(?:m|qr)(?=\s*[^\w\s\]})])'
1636    # attribute => 'Operator'
1637    # context => 'find_pattern'
1638    # type => 'RegExpr'
1639    if ($self->testRegExpr($text, '\\b(?:m|qr)(?=\\s*[^\\w\\s\\]})])', 0, 0, 0, undef, 0, 'find_pattern', 'Operator')) {
1640       return 1
1641    }
1642    # String => '[\w_]+\s*/'
1643    # attribute => 'Normal Text'
1644    # context => '#stay'
1645    # type => 'RegExpr'
1646    if ($self->testRegExpr($text, '[\\w_]+\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1647       return 1
1648    }
1649    # String => '[<>"':]/'
1650    # attribute => 'Normal Text'
1651    # context => '#stay'
1652    # type => 'RegExpr'
1653    if ($self->testRegExpr($text, '[<>"\':]/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1654       return 1
1655    }
1656    # attribute => 'Operator'
1657    # beginRegion => 'Pattern'
1658    # char => '/'
1659    # context => 'pattern_slash'
1660    # type => 'DetectChar'
1661    if ($self->testDetectChar($text, '/', 0, 0, 0, undef, 0, 'pattern_slash', 'Operator')) {
1662       return 1
1663    }
1664    # String => '-[rwxoRWXOeszfdlpSbctugkTBMAC]'
1665    # attribute => 'Operator'
1666    # context => '#stay'
1667    # type => 'RegExpr'
1668    if ($self->testRegExpr($text, '-[rwxoRWXOeszfdlpSbctugkTBMAC]', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
1669       return 1
1670    }
1671    # attribute => 'Normal Text'
1672    # beginRegion => 'Block'
1673    # char => '{'
1674    # context => '#stay'
1675    # type => 'DetectChar'
1676    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1677       return 1
1678    }
1679    # attribute => 'Normal Text'
1680    # char => '}'
1681    # context => '#stay'
1682    # endRegion => 'Block'
1683    # type => 'DetectChar'
1684    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1685       return 1
1686    }
1687    return 0;
1688 };
1689
1690 sub parsepackage_qualified_blank {
1691    my ($self, $text) = @_;
1692    # String => '[\w_]+'
1693    # attribute => 'Normal Text'
1694    # context => '#pop'
1695    # type => 'RegExpr'
1696    if ($self->testRegExpr($text, '[\\w_]+', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
1697       return 1
1698    }
1699    return 0;
1700 };
1701
1702 sub parsepat_char_class {
1703    my ($self, $text) = @_;
1704    # attribute => 'Pattern Internal Operator'
1705    # char => '^'
1706    # context => '#stay'
1707    # type => 'DetectChar'
1708    if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
1709       return 1
1710    }
1711    # attribute => 'Pattern Character Class'
1712    # char => '\'
1713    # char1 => '\'
1714    # context => '#stay'
1715    # type => 'Detect2Chars'
1716    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
1717       return 1
1718    }
1719    # attribute => 'Pattern Character Class'
1720    # char => '\'
1721    # char1 => ']'
1722    # context => '#stay'
1723    # type => 'Detect2Chars'
1724    if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
1725       return 1
1726    }
1727    # String => '\[:^?[a-z]+:\]'
1728    # attribute => 'Pattern Character Class'
1729    # context => '#stay'
1730    # type => 'RegExpr'
1731    if ($self->testRegExpr($text, '\\[:^?[a-z]+:\\]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
1732       return 1
1733    }
1734    # attribute => 'Pattern Internal Operator'
1735    # char => ']'
1736    # context => '#pop'
1737    # type => 'DetectChar'
1738    if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) {
1739       return 1
1740    }
1741    return 0;
1742 };
1743
1744 sub parsepat_ext {
1745    my ($self, $text) = @_;
1746    # String => '\#[^)]*'
1747    # attribute => 'Comment'
1748    # context => '#pop'
1749    # type => 'RegExpr'
1750    if ($self->testRegExpr($text, '\\#[^)]*', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
1751       return 1
1752    }
1753    # String => '[:=!><]+'
1754    # attribute => 'Pattern Internal Operator'
1755    # context => '#pop'
1756    # type => 'RegExpr'
1757    if ($self->testRegExpr($text, '[:=!><]+', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) {
1758       return 1
1759    }
1760    # attribute => 'Pattern Internal Operator'
1761    # char => ')'
1762    # context => '#pop'
1763    # type => 'DetectChar'
1764    if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) {
1765       return 1
1766    }
1767    return 0;
1768 };
1769
1770 sub parsepattern {
1771    my ($self, $text) = @_;
1772    # String => '\$(?=%1)'
1773    # attribute => 'Pattern Internal Operator'
1774    # context => '#stay'
1775    # dynamic => 'true'
1776    # type => 'RegExpr'
1777    if ($self->testRegExpr($text, '\\$(?=%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
1778       return 1
1779    }
1780    # String => '%1[cgimosx]*'
1781    # attribute => 'Operator'
1782    # context => '#pop#pop'
1783    # dynamic => 'true'
1784    # endRegion => 'Pattern'
1785    # type => 'RegExpr'
1786    if ($self->testRegExpr($text, '%1[cgimosx]*', 0, 1, 0, undef, 0, '#pop#pop', 'Operator')) {
1787       return 1
1788    }
1789    # context => 'regex_pattern_internal_ip'
1790    # type => 'IncludeRules'
1791    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1792       return 1
1793    }
1794    # String => '\$(?=\%1)'
1795    # attribute => 'Pattern Internal Operator'
1796    # context => '#stay'
1797    # dynamic => 'true'
1798    # type => 'RegExpr'
1799    if ($self->testRegExpr($text, '\\$(?=\\%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
1800       return 1
1801    }
1802    return 0;
1803 };
1804
1805 sub parsepattern_brace {
1806    my ($self, $text) = @_;
1807    # String => '\}[cgimosx]*'
1808    # attribute => 'Operator'
1809    # context => '#pop#pop'
1810    # endRegion => 'Pattern'
1811    # type => 'RegExpr'
1812    if ($self->testRegExpr($text, '\\}[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
1813       return 1
1814    }
1815    # context => 'regex_pattern_internal_ip'
1816    # type => 'IncludeRules'
1817    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1818       return 1
1819    }
1820    return 0;
1821 };
1822
1823 sub parsepattern_bracket {
1824    my ($self, $text) = @_;
1825    # String => '\][cgimosx]*'
1826    # attribute => 'Operator'
1827    # context => '#pop#pop'
1828    # endRegion => 'Pattern'
1829    # type => 'RegExpr'
1830    if ($self->testRegExpr($text, '\\][cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
1831       return 1
1832    }
1833    # context => 'regex_pattern_internal_ip'
1834    # type => 'IncludeRules'
1835    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1836       return 1
1837    }
1838    return 0;
1839 };
1840
1841 sub parsepattern_paren {
1842    my ($self, $text) = @_;
1843    # String => '\)[cgimosx]*'
1844    # attribute => 'Operator'
1845    # context => '#pop#pop'
1846    # endRegion => 'Pattern'
1847    # type => 'RegExpr'
1848    if ($self->testRegExpr($text, '\\)[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
1849       return 1
1850    }
1851    # context => 'regex_pattern_internal_ip'
1852    # type => 'IncludeRules'
1853    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1854       return 1
1855    }
1856    return 0;
1857 };
1858
1859 sub parsepattern_slash {
1860    my ($self, $text) = @_;
1861    # String => '\$(?=/)'
1862    # attribute => 'Pattern Internal Operator'
1863    # context => '#stay'
1864    # type => 'RegExpr'
1865    if ($self->testRegExpr($text, '\\$(?=/)', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
1866       return 1
1867    }
1868    # context => 'regex_pattern_internal_ip'
1869    # type => 'IncludeRules'
1870    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1871       return 1
1872    }
1873    # String => '/[cgimosx]*'
1874    # attribute => 'Operator'
1875    # context => '#pop'
1876    # endRegion => 'Pattern'
1877    # type => 'RegExpr'
1878    if ($self->testRegExpr($text, '/[cgimosx]*', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
1879       return 1
1880    }
1881    return 0;
1882 };
1883
1884 sub parsepattern_sq {
1885    my ($self, $text) = @_;
1886    # String => ''[cgimosx]*'
1887    # attribute => 'Operator'
1888    # context => '#pop#pop'
1889    # endRegion => 'Pattern'
1890    # type => 'RegExpr'
1891    if ($self->testRegExpr($text, '\'[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
1892       return 1
1893    }
1894    # context => 'regex_pattern_internal'
1895    # type => 'IncludeRules'
1896    if ($self->includeRules('regex_pattern_internal', $text)) {
1897       return 1
1898    }
1899    return 0;
1900 };
1901
1902 sub parsepod {
1903    my ($self, $text) = @_;
1904    # type => 'DetectSpaces'
1905    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1906       return 1
1907    }
1908    # type => 'DetectIdentifier'
1909    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1910       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    if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s*.*', 0, 0, 0, 0, 0, '#stay', 'Pod')) {
1920       return 1
1921    }
1922    # String => '\=cut.*$'
1923    # attribute => 'Pod'
1924    # column => '0'
1925    # context => '#pop'
1926    # endRegion => 'POD'
1927    # type => 'RegExpr'
1928    if ($self->testRegExpr($text, '\\=cut.*$', 0, 0, 0, 0, 0, '#pop', 'Pod')) {
1929       return 1
1930    }
1931    return 0;
1932 };
1933
1934 sub parsequote_word {
1935    my ($self, $text) = @_;
1936    # type => 'DetectSpaces'
1937    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1938       return 1
1939    }
1940    # type => 'DetectIdentifier'
1941    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1942       return 1
1943    }
1944    # String => '\\%1'
1945    # attribute => 'Normal Text'
1946    # context => '#stay'
1947    # dynamic => 'true'
1948    # type => 'RegExpr'
1949    if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'Normal Text')) {
1950       return 1
1951    }
1952    # attribute => 'Operator'
1953    # char => '1'
1954    # context => '#pop#pop#pop'
1955    # dynamic => 'true'
1956    # endRegion => 'Wordlist'
1957    # type => 'DetectChar'
1958    if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1959       return 1
1960    }
1961    return 0;
1962 };
1963
1964 sub parsequote_word_brace {
1965    my ($self, $text) = @_;
1966    # type => 'DetectSpaces'
1967    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1968       return 1
1969    }
1970    # type => 'DetectIdentifier'
1971    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1972       return 1
1973    }
1974    # attribute => 'Normal Text'
1975    # char => '\'
1976    # char1 => '}'
1977    # context => '#stay'
1978    # type => 'Detect2Chars'
1979    if ($self->testDetect2Chars($text, '\\', '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1980       return 1
1981    }
1982    # attribute => 'Operator'
1983    # char => '}'
1984    # context => '#pop#pop#pop'
1985    # endRegion => 'Wordlist'
1986    # type => 'DetectChar'
1987    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1988       return 1
1989    }
1990    return 0;
1991 };
1992
1993 sub parsequote_word_bracket {
1994    my ($self, $text) = @_;
1995    # type => 'DetectSpaces'
1996    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1997       return 1
1998    }
1999    # type => 'DetectIdentifier'
2000    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2001       return 1
2002    }
2003    # attribute => 'Normal Text'
2004    # char => '\'
2005    # char1 => ']'
2006    # context => '#stay'
2007    # type => 'Detect2Chars'
2008    if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2009       return 1
2010    }
2011    # attribute => 'Operator'
2012    # char => ']'
2013    # context => '#pop#pop#pop'
2014    # endRegion => 'Wordlist'
2015    # type => 'DetectChar'
2016    if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2017       return 1
2018    }
2019    return 0;
2020 };
2021
2022 sub parsequote_word_paren {
2023    my ($self, $text) = @_;
2024    # type => 'DetectSpaces'
2025    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
2026       return 1
2027    }
2028    # type => 'DetectIdentifier'
2029    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2030       return 1
2031    }
2032    # attribute => 'Normal Text'
2033    # char => '\'
2034    # char1 => ')'
2035    # context => '#stay'
2036    # type => 'Detect2Chars'
2037    if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2038       return 1
2039    }
2040    # attribute => 'Operator'
2041    # char => ')'
2042    # context => '#pop#pop#pop'
2043    # endRegion => 'Wordlist'
2044    # type => 'DetectChar'
2045    if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2046       return 1
2047    }
2048    return 0;
2049 };
2050
2051 sub parseregex_pattern_internal {
2052    my ($self, $text) = @_;
2053    # context => 'regex_pattern_internal_rules_1'
2054    # type => 'IncludeRules'
2055    if ($self->includeRules('regex_pattern_internal_rules_1', $text)) {
2056       return 1
2057    }
2058    # context => 'regex_pattern_internal_rules_2'
2059    # type => 'IncludeRules'
2060    if ($self->includeRules('regex_pattern_internal_rules_2', $text)) {
2061       return 1
2062    }
2063    return 0;
2064 };
2065
2066 sub parseregex_pattern_internal_ip {
2067    my ($self, $text) = @_;
2068    # context => 'regex_pattern_internal_rules_1'
2069    # type => 'IncludeRules'
2070    if ($self->includeRules('regex_pattern_internal_rules_1', $text)) {
2071       return 1
2072    }
2073    # String => '[$@][^]\s{}()|>']'
2074    # attribute => 'Data Type'
2075    # context => 'find_variable_unsafe'
2076    # lookAhead => 'true'
2077    # type => 'RegExpr'
2078    if ($self->testRegExpr($text, '[$@][^]\\s{}()|>\']', 0, 0, 1, undef, 0, 'find_variable_unsafe', 'Data Type')) {
2079       return 1
2080    }
2081    # context => 'regex_pattern_internal_rules_2'
2082    # type => 'IncludeRules'
2083    if ($self->includeRules('regex_pattern_internal_rules_2', $text)) {
2084       return 1
2085    }
2086    return 0;
2087 };
2088
2089 sub parseregex_pattern_internal_rules_1 {
2090    my ($self, $text) = @_;
2091    # String => '#.*$'
2092    # attribute => 'Comment'
2093    # context => '#stay'
2094    # firstNonSpace => 'true'
2095    # type => 'RegExpr'
2096    if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) {
2097       return 1
2098    }
2099    # String => '\\[anDdSsWw]'
2100    # attribute => 'Pattern Character Class'
2101    # context => '#stay'
2102    # type => 'RegExpr'
2103    if ($self->testRegExpr($text, '\\\\[anDdSsWw]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
2104       return 1
2105    }
2106    # String => '\\[ABbEGLlNUuQdQZz]'
2107    # attribute => 'Pattern Internal Operator'
2108    # context => '#stay'
2109    # type => 'RegExpr'
2110    if ($self->testRegExpr($text, '\\\\[ABbEGLlNUuQdQZz]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2111       return 1
2112    }
2113    # String => '\\[\d]+'
2114    # attribute => 'Special Variable'
2115    # context => '#stay'
2116    # type => 'RegExpr'
2117    if ($self->testRegExpr($text, '\\\\[\\d]+', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) {
2118       return 1
2119    }
2120    # String => '\\.'
2121    # attribute => 'Pattern'
2122    # context => '#stay'
2123    # type => 'RegExpr'
2124    if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Pattern')) {
2125       return 1
2126    }
2127    return 0;
2128 };
2129
2130 sub parseregex_pattern_internal_rules_2 {
2131    my ($self, $text) = @_;
2132    # attribute => 'Pattern Internal Operator'
2133    # char => '('
2134    # char1 => '?'
2135    # context => 'pat_ext'
2136    # type => 'Detect2Chars'
2137    if ($self->testDetect2Chars($text, '(', '?', 0, 0, 0, undef, 0, 'pat_ext', 'Pattern Internal Operator')) {
2138       return 1
2139    }
2140    # attribute => 'Pattern Internal Operator'
2141    # char => '['
2142    # context => 'pat_char_class'
2143    # type => 'DetectChar'
2144    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'pat_char_class', 'Pattern Internal Operator')) {
2145       return 1
2146    }
2147    # String => '[()?^*+|]'
2148    # attribute => 'Pattern Internal Operator'
2149    # context => '#stay'
2150    # type => 'RegExpr'
2151    if ($self->testRegExpr($text, '[()?^*+|]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2152       return 1
2153    }
2154    # String => '\{[\d, ]+\}'
2155    # attribute => 'Pattern Internal Operator'
2156    # context => '#stay'
2157    # type => 'RegExpr'
2158    if ($self->testRegExpr($text, '\\{[\\d, ]+\\}', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2159       return 1
2160    }
2161    # attribute => 'Pattern Internal Operator'
2162    # char => '$'
2163    # context => '#stay'
2164    # type => 'DetectChar'
2165    if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2166       return 1
2167    }
2168    # String => '\s{3,}#.*$'
2169    # attribute => 'Comment'
2170    # context => '#stay'
2171    # type => 'RegExpr'
2172    if ($self->testRegExpr($text, '\\s{3,}#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2173       return 1
2174    }
2175    return 0;
2176 };
2177
2178 sub parseslash_safe_escape {
2179    my ($self, $text) = @_;
2180    # String => '\s*\]?\s*/'
2181    # attribute => 'Normal Text'
2182    # context => '#pop'
2183    # type => 'RegExpr'
2184    if ($self->testRegExpr($text, '\\s*\\]?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
2185       return 1
2186    }
2187    # String => '\s*\}?\s*/'
2188    # attribute => 'Normal Text'
2189    # context => '#pop'
2190    # endRegion => 'Block'
2191    # type => 'RegExpr'
2192    if ($self->testRegExpr($text, '\\s*\\}?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
2193       return 1
2194    }
2195    # String => '\s*\)?\s*/'
2196    # attribute => 'Normal Text'
2197    # context => '#pop'
2198    # type => 'RegExpr'
2199    if ($self->testRegExpr($text, '\\s*\\)?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
2200       return 1
2201    }
2202    # String => 'keywords'
2203    # attribute => 'Keyword'
2204    # context => '#pop'
2205    # type => 'keyword'
2206    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#pop', 'Keyword')) {
2207       return 1
2208    }
2209    return 0;
2210 };
2211
2212 sub parsestring {
2213    my ($self, $text) = @_;
2214    # type => 'DetectIdentifier'
2215    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2216       return 1
2217    }
2218    # attribute => 'String Special Character'
2219    # char => '\'
2220    # char1 => '''
2221    # context => '#stay'
2222    # type => 'Detect2Chars'
2223    if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2224       return 1
2225    }
2226    # attribute => 'String Special Character'
2227    # char => '\'
2228    # char1 => '\'
2229    # context => '#stay'
2230    # type => 'Detect2Chars'
2231    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2232       return 1
2233    }
2234    # attribute => 'Operator'
2235    # char => '''
2236    # context => '#pop'
2237    # endRegion => 'String'
2238    # type => 'DetectChar'
2239    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
2240       return 1
2241    }
2242    return 0;
2243 };
2244
2245 sub parsestring_2 {
2246    my ($self, $text) = @_;
2247    # type => 'DetectIdentifier'
2248    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2249       return 1
2250    }
2251    # attribute => 'String Special Character'
2252    # char => '\'
2253    # char1 => ')'
2254    # context => '#stay'
2255    # type => 'Detect2Chars'
2256    if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2257       return 1
2258    }
2259    # attribute => 'String Special Character'
2260    # char => '\'
2261    # char1 => '\'
2262    # context => '#stay'
2263    # type => 'Detect2Chars'
2264    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2265       return 1
2266    }
2267    # attribute => 'String'
2268    # char => '('
2269    # char1 => ')'
2270    # context => '#stay'
2271    # type => 'RangeDetect'
2272    if ($self->testRangeDetect($text, '(', ')', 0, 0, undef, 0, '#stay', 'String')) {
2273       return 1
2274    }
2275    # attribute => 'Operator'
2276    # char => ')'
2277    # context => '#pop#pop'
2278    # endRegion => 'String'
2279    # type => 'DetectChar'
2280    if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
2281       return 1
2282    }
2283    return 0;
2284 };
2285
2286 sub parsestring_3 {
2287    my ($self, $text) = @_;
2288    # type => 'DetectIdentifier'
2289    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2290       return 1
2291    }
2292    # attribute => 'String Special Character'
2293    # char => '\'
2294    # char1 => '}'
2295    # context => '#stay'
2296    # type => 'Detect2Chars'
2297    if ($self->testDetect2Chars($text, '\\', '}', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2298       return 1
2299    }
2300    # attribute => 'String Special Character'
2301    # char => '\'
2302    # char1 => '\'
2303    # context => '#stay'
2304    # type => 'Detect2Chars'
2305    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2306       return 1
2307    }
2308    # attribute => 'String'
2309    # char => '{'
2310    # char1 => '}'
2311    # context => '#stay'
2312    # type => 'RangeDetect'
2313    if ($self->testRangeDetect($text, '{', '}', 0, 0, undef, 0, '#stay', 'String')) {
2314       return 1
2315    }
2316    # attribute => 'Operator'
2317    # char => '}'
2318    # context => '#pop#pop'
2319    # endRegion => 'String'
2320    # type => 'DetectChar'
2321    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
2322       return 1
2323    }
2324    return 0;
2325 };
2326
2327 sub parsestring_4 {
2328    my ($self, $text) = @_;
2329    # type => 'DetectIdentifier'
2330    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2331       return 1
2332    }
2333    # attribute => 'String Special Character'
2334    # char => '\'
2335    # char1 => ']'
2336    # context => '#stay'
2337    # type => 'Detect2Chars'
2338    if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2339       return 1
2340    }
2341    # attribute => 'String Special Character'
2342    # char => '\'
2343    # char1 => '\'
2344    # context => '#stay'
2345    # type => 'Detect2Chars'
2346    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2347       return 1
2348    }
2349    # attribute => 'String'
2350    # char => '['
2351    # char1 => ']'
2352    # context => '#stay'
2353    # type => 'RangeDetect'
2354    if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'String')) {
2355       return 1
2356    }
2357    # attribute => 'Operator'
2358    # char => ']'
2359    # context => '#pop#pop'
2360    # endRegion => 'String'
2361    # type => 'DetectChar'
2362    if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
2363       return 1
2364    }
2365    return 0;
2366 };
2367
2368 sub parsestring_5 {
2369    my ($self, $text) = @_;
2370    # type => 'DetectIdentifier'
2371    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2372       return 1
2373    }
2374    # attribute => 'String Special Character'
2375    # char => '\'
2376    # char1 => '<'
2377    # context => '#stay'
2378    # type => 'Detect2Chars'
2379    if ($self->testDetect2Chars($text, '\\', '<', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2380       return 1
2381    }
2382    # attribute => 'String Special Character'
2383    # char => '\'
2384    # char1 => '\'
2385    # context => '#stay'
2386    # type => 'Detect2Chars'
2387    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2388       return 1
2389    }
2390    # attribute => 'String'
2391    # char => '\'
2392    # char1 => '>'
2393    # context => '#stay'
2394    # type => 'Detect2Chars'
2395    if ($self->testDetect2Chars($text, '\\', '>', 0, 0, 0, undef, 0, '#stay', 'String')) {
2396       return 1
2397    }
2398    # attribute => 'String'
2399    # char => '<'
2400    # char1 => '>'
2401    # context => '#stay'
2402    # type => 'RangeDetect'
2403    if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'String')) {
2404       return 1
2405    }
2406    # attribute => 'Operator'
2407    # char => '>'
2408    # context => '#pop#pop'
2409    # endRegion => 'String'
2410    # type => 'DetectChar'
2411    if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
2412       return 1
2413    }
2414    return 0;
2415 };
2416
2417 sub parsestring_6 {
2418    my ($self, $text) = @_;
2419    # type => 'DetectIdentifier'
2420    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2421       return 1
2422    }
2423    # attribute => 'String Special Character'
2424    # char => '\'
2425    # char1 => '\'
2426    # context => '#stay'
2427    # type => 'Detect2Chars'
2428    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2429       return 1
2430    }
2431    # String => '\\%1'
2432    # attribute => 'String Special Character'
2433    # context => '#stay'
2434    # dynamic => 'true'
2435    # type => 'RegExpr'
2436    if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'String Special Character')) {
2437       return 1
2438    }
2439    # attribute => 'Operator'
2440    # char => '1'
2441    # context => '#pop#pop'
2442    # dynamic => 'true'
2443    # endRegion => 'String'
2444    # type => 'DetectChar'
2445    if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop', 'Operator')) {
2446       return 1
2447    }
2448    return 0;
2449 };
2450
2451 sub parsesub_arg_definition {
2452    my ($self, $text) = @_;
2453    # String => '*$@%'
2454    # attribute => 'Data Type'
2455    # context => '#stay'
2456    # type => 'AnyChar'
2457    if ($self->testAnyChar($text, '*$@%', 0, 0, undef, 0, '#stay', 'Data Type')) {
2458       return 1
2459    }
2460    # String => '&\[];'
2461    # attribute => 'Normal Text'
2462    # context => '#stay'
2463    # type => 'AnyChar'
2464    if ($self->testAnyChar($text, '&\\[];', 0, 0, undef, 0, '#stay', 'Normal Text')) {
2465       return 1
2466    }
2467    # attribute => 'Normal Text'
2468    # char => ')'
2469    # context => 'slash_safe_escape'
2470    # type => 'DetectChar'
2471    if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, 'slash_safe_escape', 'Normal Text')) {
2472       return 1
2473    }
2474    return 0;
2475 };
2476
2477 sub parsesub_name_def {
2478    my ($self, $text) = @_;
2479    # String => '\w+'
2480    # attribute => 'Function'
2481    # context => '#stay'
2482    # type => 'RegExpr'
2483    if ($self->testRegExpr($text, '\\w+', 0, 0, 0, undef, 0, '#stay', 'Function')) {
2484       return 1
2485    }
2486    # String => '\$\S'
2487    # attribute => 'Normal Text'
2488    # context => 'find_variable'
2489    # lookAhead => 'true'
2490    # type => 'RegExpr'
2491    if ($self->testRegExpr($text, '\\$\\S', 0, 0, 1, undef, 0, 'find_variable', 'Normal Text')) {
2492       return 1
2493    }
2494    # String => '\s*\('
2495    # attribute => 'Normal Text'
2496    # context => 'sub_arg_definition'
2497    # type => 'RegExpr'
2498    if ($self->testRegExpr($text, '\\s*\\(', 0, 0, 0, undef, 0, 'sub_arg_definition', 'Normal Text')) {
2499       return 1
2500    }
2501    # attribute => 'Normal Text'
2502    # char => ':'
2503    # char1 => ':'
2504    # context => '#stay'
2505    # type => 'Detect2Chars'
2506    if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2507       return 1
2508    }
2509    return 0;
2510 };
2511
2512 sub parsesubst_bracket_pattern {
2513    my ($self, $text) = @_;
2514    # String => '\s+#.*$'
2515    # attribute => 'Comment'
2516    # context => '#stay'
2517    # type => 'RegExpr'
2518    if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2519       return 1
2520    }
2521    # context => 'regex_pattern_internal_ip'
2522    # type => 'IncludeRules'
2523    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
2524       return 1
2525    }
2526    # attribute => 'Operator'
2527    # char => ']'
2528    # context => 'subst_bracket_replace'
2529    # endRegion => 'Pattern'
2530    # type => 'DetectChar'
2531    if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, 'subst_bracket_replace', 'Operator')) {
2532       return 1
2533    }
2534    return 0;
2535 };
2536
2537 sub parsesubst_bracket_replace {
2538    my ($self, $text) = @_;
2539    # context => 'ipstring_internal'
2540    # type => 'IncludeRules'
2541    if ($self->includeRules('ipstring_internal', $text)) {
2542       return 1
2543    }
2544    # attribute => 'Operator'
2545    # beginRegion => 'Replacement'
2546    # char => '['
2547    # context => '#stay'
2548    # type => 'DetectChar'
2549    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2550       return 1
2551    }
2552    # String => '\][cegimosx]*'
2553    # attribute => 'Operator'
2554    # context => '#pop#pop#pop'
2555    # endRegion => 'Replacement'
2556    # type => 'RegExpr'
2557    if ($self->testRegExpr($text, '\\][cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2558       return 1
2559    }
2560    return 0;
2561 };
2562
2563 sub parsesubst_curlybrace_middle {
2564    my ($self, $text) = @_;
2565    # String => '#.*$'
2566    # attribute => 'Comment'
2567    # context => '#stay'
2568    # type => 'RegExpr'
2569    if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2570       return 1
2571    }
2572    # attribute => 'Operator'
2573    # beginRegion => 'Replacement'
2574    # char => '{'
2575    # context => 'subst_curlybrace_replace'
2576    # type => 'DetectChar'
2577    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace', 'Operator')) {
2578       return 1
2579    }
2580    return 0;
2581 };
2582
2583 sub parsesubst_curlybrace_pattern {
2584    my ($self, $text) = @_;
2585    # String => '\s+#.*$'
2586    # attribute => 'Comment'
2587    # context => '#stay'
2588    # type => 'RegExpr'
2589    if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2590       return 1
2591    }
2592    # context => 'regex_pattern_internal_ip'
2593    # type => 'IncludeRules'
2594    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
2595       return 1
2596    }
2597    # attribute => 'Operator'
2598    # char => '}'
2599    # context => 'subst_curlybrace_middle'
2600    # endRegion => 'Pattern'
2601    # type => 'DetectChar'
2602    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'subst_curlybrace_middle', 'Operator')) {
2603       return 1
2604    }
2605    return 0;
2606 };
2607
2608 sub parsesubst_curlybrace_replace {
2609    my ($self, $text) = @_;
2610    # context => 'ipstring_internal'
2611    # type => 'IncludeRules'
2612    if ($self->includeRules('ipstring_internal', $text)) {
2613       return 1
2614    }
2615    # attribute => 'Normal Text'
2616    # beginRegion => 'Block'
2617    # char => '{'
2618    # context => 'subst_curlybrace_replace_recursive'
2619    # type => 'DetectChar'
2620    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace_recursive', 'Normal Text')) {
2621       return 1
2622    }
2623    # String => '\}[cegimosx]*'
2624    # attribute => 'Operator'
2625    # context => '#pop#pop#pop#pop'
2626    # endRegion => 'Replacement'
2627    # type => 'RegExpr'
2628    if ($self->testRegExpr($text, '\\}[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop#pop', 'Operator')) {
2629       return 1
2630    }
2631    return 0;
2632 };
2633
2634 sub parsesubst_curlybrace_replace_recursive {
2635    my ($self, $text) = @_;
2636    # attribute => 'String (interpolated)'
2637    # beginRegion => 'Block'
2638    # char => '{'
2639    # context => 'subst_curlybrace_replace_recursive'
2640    # type => 'DetectChar'
2641    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace_recursive', 'String (interpolated)')) {
2642       return 1
2643    }
2644    # attribute => 'Normal Text'
2645    # char => '}'
2646    # context => '#pop'
2647    # endRegion => 'Block'
2648    # type => 'DetectChar'
2649    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
2650       return 1
2651    }
2652    # context => 'ipstring_internal'
2653    # type => 'IncludeRules'
2654    if ($self->includeRules('ipstring_internal', $text)) {
2655       return 1
2656    }
2657    return 0;
2658 };
2659
2660 sub parsesubst_paren_pattern {
2661    my ($self, $text) = @_;
2662    # String => '\s+#.*$'
2663    # attribute => 'Comment'
2664    # context => '#stay'
2665    # type => 'RegExpr'
2666    if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2667       return 1
2668    }
2669    # context => 'regex_pattern_internal_ip'
2670    # type => 'IncludeRules'
2671    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
2672       return 1
2673    }
2674    # attribute => 'Operator'
2675    # char => '}'
2676    # context => 'subst_paren_replace'
2677    # endRegion => 'Pattern'
2678    # type => 'DetectChar'
2679    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'subst_paren_replace', 'Operator')) {
2680       return 1
2681    }
2682    return 0;
2683 };
2684
2685 sub parsesubst_paren_replace {
2686    my ($self, $text) = @_;
2687    # context => 'ipstring_internal'
2688    # type => 'IncludeRules'
2689    if ($self->includeRules('ipstring_internal', $text)) {
2690       return 1
2691    }
2692    # attribute => 'Operator'
2693    # beginRegion => 'Replacement'
2694    # char => '('
2695    # context => '#stay'
2696    # type => 'DetectChar'
2697    if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2698       return 1
2699    }
2700    # String => '\)[cegimosx]*'
2701    # attribute => 'Operator'
2702    # context => '#pop#pop#pop'
2703    # endRegion => 'Replacement'
2704    # type => 'RegExpr'
2705    if ($self->testRegExpr($text, '\\)[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2706       return 1
2707    }
2708    return 0;
2709 };
2710
2711 sub parsesubst_slash_pattern {
2712    my ($self, $text) = @_;
2713    # String => '\$(?=%1)'
2714    # attribute => 'Pattern Internal Operator'
2715    # context => '#stay'
2716    # dynamic => 'true'
2717    # type => 'RegExpr'
2718    if ($self->testRegExpr($text, '\\$(?=%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2719       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    if ($self->testRegExpr($text, '(%1)', 0, 1, 0, undef, 0, 'subst_slash_replace', 'Operator')) {
2729       return 1
2730    }
2731    # context => 'regex_pattern_internal_ip'
2732    # type => 'IncludeRules'
2733    if ($self->includeRules('regex_pattern_internal_ip', $text)) {
2734       return 1
2735    }
2736    return 0;
2737 };
2738
2739 sub parsesubst_slash_replace {
2740    my ($self, $text) = @_;
2741    # context => 'ipstring_internal'
2742    # type => 'IncludeRules'
2743    if ($self->includeRules('ipstring_internal', $text)) {
2744       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    if ($self->testRegExpr($text, '%1[cegimosx]*', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2753       return 1
2754    }
2755    return 0;
2756 };
2757
2758 sub parsesubst_sq_pattern {
2759    my ($self, $text) = @_;
2760    # String => '\s+#.*$'
2761    # attribute => 'Comment'
2762    # context => '#stay'
2763    # type => 'RegExpr'
2764    if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2765       return 1
2766    }
2767    # context => 'regex_pattern_internal'
2768    # type => 'IncludeRules'
2769    if ($self->includeRules('regex_pattern_internal', $text)) {
2770       return 1
2771    }
2772    # attribute => 'Operator'
2773    # beginRegion => 'Pattern'
2774    # char => '''
2775    # context => 'subst_sq_replace'
2776    # endRegion => 'Pattern'
2777    # type => 'DetectChar'
2778    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'subst_sq_replace', 'Operator')) {
2779       return 1
2780    }
2781    return 0;
2782 };
2783
2784 sub parsesubst_sq_replace {
2785    my ($self, $text) = @_;
2786    # String => ''[cegimosx]*'
2787    # attribute => 'Operator'
2788    # context => '#pop#pop#pop'
2789    # endRegion => 'Replacement'
2790    # type => 'RegExpr'
2791    if ($self->testRegExpr($text, '\'[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2792       return 1
2793    }
2794    return 0;
2795 };
2796
2797 sub parsetr {
2798    my ($self, $text) = @_;
2799    # String => '\([^)]*\)\s*\(?:[^)]*\)'
2800    # attribute => 'Pattern'
2801    # context => '#pop'
2802    # type => 'RegExpr'
2803    if ($self->testRegExpr($text, '\\([^)]*\\)\\s*\\(?:[^)]*\\)', 0, 0, 0, undef, 0, '#pop', 'Pattern')) {
2804       return 1
2805    }
2806    # String => '\{[^}]*\}\s*\{[^}]*\}'
2807    # attribute => 'Pattern'
2808    # context => '#pop'
2809    # type => 'RegExpr'
2810    if ($self->testRegExpr($text, '\\{[^}]*\\}\\s*\\{[^}]*\\}', 0, 0, 0, undef, 0, '#pop', 'Pattern')) {
2811       return 1
2812    }
2813    # String => '\[[^}]*\]\s*\[[^\]]*\]'
2814    # attribute => 'Pattern'
2815    # context => '#pop'
2816    # type => 'RegExpr'
2817    if ($self->testRegExpr($text, '\\[[^}]*\\]\\s*\\[[^\\]]*\\]', 0, 0, 0, undef, 0, '#pop', 'Pattern')) {
2818       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    if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()]).*?\\1.*?\\1', 0, 0, 0, undef, 0, '#pop', 'Pattern')) {
2826       return 1
2827    }
2828    return 0;
2829 };
2830
2831 sub parsevar_detect {
2832    my ($self, $text) = @_;
2833    # context => 'var_detect_rules'
2834    # type => 'IncludeRules'
2835    if ($self->includeRules('var_detect_rules', $text)) {
2836       return 1
2837    }
2838    # context => 'slash_safe_escape'
2839    # type => 'IncludeRules'
2840    if ($self->includeRules('slash_safe_escape', $text)) {
2841       return 1
2842    }
2843    return 0;
2844 };
2845
2846 sub parsevar_detect_rules {
2847    my ($self, $text) = @_;
2848    # String => '[\w_]+'
2849    # attribute => 'Data Type'
2850    # context => '#stay'
2851    # type => 'RegExpr'
2852    if ($self->testRegExpr($text, '[\\w_]+', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
2853       return 1
2854    }
2855    # attribute => 'Normal Text'
2856    # char => ':'
2857    # char1 => ':'
2858    # context => '#stay'
2859    # type => 'Detect2Chars'
2860    if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2861       return 1
2862    }
2863    # attribute => 'Operator'
2864    # char => '''
2865    # context => '#stay'
2866    # type => 'DetectChar'
2867    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2868       return 1
2869    }
2870    # attribute => 'Normal Text'
2871    # char => '-'
2872    # char1 => '>'
2873    # context => '#stay'
2874    # type => 'Detect2Chars'
2875    if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2876       return 1
2877    }
2878    # attribute => 'Normal Text'
2879    # char => '+'
2880    # char1 => '+'
2881    # context => '#stay'
2882    # type => 'Detect2Chars'
2883    if ($self->testDetect2Chars($text, '+', '+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2884       return 1
2885    }
2886    # attribute => 'Normal Text'
2887    # char => '-'
2888    # char1 => '-'
2889    # context => '#stay'
2890    # type => 'Detect2Chars'
2891    if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2892       return 1
2893    }
2894    return 0;
2895 };
2896
2897 sub parsevar_detect_unsafe {
2898    my ($self, $text) = @_;
2899    # context => 'var_detect_rules'
2900    # type => 'IncludeRules'
2901    if ($self->includeRules('var_detect_rules', $text)) {
2902       return 1
2903    }
2904    return 0;
2905 };
2906
2907
2908 1;
2909
2910 __END__
2911
2912 =head1 NAME
2913
2914 Syntax::Highlight::Engine::Kate::Perl - a Plugin for Perl syntax highlighting
2915
2916 =head1 SYNOPSIS
2917
2918  require Syntax::Highlight::Engine::Kate::Perl;
2919  my $sh = new Syntax::Highlight::Engine::Kate::Perl([
2920  ]);
2921
2922 =head1 DESCRIPTION
2923
2924 Syntax::Highlight::Engine::Kate::Perl is a  plugin module that provides syntax highlighting
2925 for Perl to the Syntax::Haghlight::Engine::Kate highlighting engine.
2926
2927 This code is generated from the syntax definition files used
2928 by the Kate project.
2929 It works quite fine, but can use refinement and optimization.
2930
2931 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
2932
2933 =cut
2934
2935 =head1 AUTHOR
2936
2937 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
2938
2939 =cut
2940
2941 =head1 BUGS
2942
2943 Unknown. If you find any, please contact the author
2944
2945 =cut
2946