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.
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
10 #kate author Anders Lund (anders@alweb.dk)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Perl;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
26 'Comment' => 'Comment',
28 'Data Type' => 'DataType',
29 'Decimal' => 'DecVal',
31 'Function' => 'Function',
33 'Keyword' => 'Keyword',
34 'Normal Text' => 'Normal',
35 'Nothing' => 'Comment',
37 'Operator' => 'Operator',
38 'Pattern' => 'Others',
39 'Pattern Character Class' => 'BaseN',
40 'Pattern Internal Operator' => 'Char',
42 'Pragma' => 'Keyword',
43 'Special Variable' => 'Variable',
45 'String (interpolated)' => 'String',
46 'String Special Character' => 'Char',
48 $self->listAdd('functions',
242 $self->listAdd('keywords',
275 $self->listAdd('operators',
315 $self->listAdd('pragmas',
334 callback => \&parseBackticked,
335 attribute => 'String (interpolated)',
338 callback => \&parsecomment,
339 attribute => 'Comment',
340 lineending => '#pop',
343 callback => \&parsedata_handle,
347 callback => \&parseend_handle,
348 attribute => 'Nothing',
350 'find_here_document' => {
351 callback => \&parsefind_here_document,
352 attribute => 'Normal Text',
353 lineending => '#pop',
356 callback => \&parsefind_pattern,
357 attribute => 'Pattern',
360 callback => \&parsefind_qqx,
361 attribute => 'Normal Text',
364 callback => \&parsefind_quoted,
365 attribute => 'Normal Text',
368 callback => \&parsefind_qw,
369 attribute => 'Normal Text',
372 callback => \&parsefind_subst,
373 attribute => 'Normal Text',
376 callback => \&parsefind_variable,
377 attribute => 'Data Type',
378 lineending => '#pop',
379 fallthrough => '#pop',
381 'find_variable_unsafe' => {
382 callback => \&parsefind_variable_unsafe,
383 attribute => 'Data Type',
384 lineending => '#pop',
385 fallthrough => '#pop',
388 callback => \&parsehere_document,
389 attribute => 'String (interpolated)',
392 'here_document_dumb' => {
393 callback => \&parsehere_document_dumb,
394 attribute => 'Normal Text',
398 callback => \&parseip_string,
399 attribute => 'String (interpolated)',
402 callback => \&parseip_string_2,
403 attribute => 'String (interpolated)',
406 callback => \&parseip_string_3,
407 attribute => 'String (interpolated)',
410 callback => \&parseip_string_4,
411 attribute => 'String (interpolated)',
414 callback => \&parseip_string_5,
415 attribute => 'String (interpolated)',
418 callback => \&parseip_string_6,
419 attribute => 'String (interpolated)',
422 'ipstring_internal' => {
423 callback => \&parseipstring_internal,
424 attribute => 'String (interpolated)',
427 callback => \&parsenormal,
428 attribute => 'Normal Text',
430 'package_qualified_blank' => {
431 callback => \&parsepackage_qualified_blank,
432 attribute => 'Normal Text',
434 'pat_char_class' => {
435 callback => \&parsepat_char_class,
436 attribute => 'Pattern Character Class',
439 callback => \&parsepat_ext,
440 attribute => 'Pattern Internal Operator',
443 callback => \&parsepattern,
444 attribute => 'Pattern',
448 callback => \&parsepattern_brace,
449 attribute => 'Pattern',
451 'pattern_bracket' => {
452 callback => \&parsepattern_bracket,
453 attribute => 'Pattern',
456 callback => \&parsepattern_paren,
457 attribute => 'Pattern',
460 callback => \&parsepattern_slash,
461 attribute => 'Pattern',
464 callback => \&parsepattern_sq,
465 attribute => 'Pattern',
468 callback => \&parsepod,
472 callback => \&parsequote_word,
473 attribute => 'Normal Text',
476 'quote_word_brace' => {
477 callback => \&parsequote_word_brace,
478 attribute => 'Normal Text',
480 'quote_word_bracket' => {
481 callback => \&parsequote_word_bracket,
482 attribute => 'Normal Text',
484 'quote_word_paren' => {
485 callback => \&parsequote_word_paren,
486 attribute => 'Normal Text',
488 'regex_pattern_internal' => {
489 callback => \&parseregex_pattern_internal,
490 attribute => 'Pattern',
492 'regex_pattern_internal_ip' => {
493 callback => \&parseregex_pattern_internal_ip,
494 attribute => 'Pattern',
496 'regex_pattern_internal_rules_1' => {
497 callback => \&parseregex_pattern_internal_rules_1,
499 'regex_pattern_internal_rules_2' => {
500 callback => \&parseregex_pattern_internal_rules_2,
502 'slash_safe_escape' => {
503 callback => \&parseslash_safe_escape,
504 attribute => 'Normal Text',
505 lineending => '#pop',
506 fallthrough => '#pop',
509 callback => \&parsestring,
510 attribute => 'String',
513 callback => \&parsestring_2,
514 attribute => 'String',
517 callback => \&parsestring_3,
518 attribute => 'String',
521 callback => \&parsestring_4,
522 attribute => 'String',
525 callback => \&parsestring_5,
526 attribute => 'String',
529 callback => \&parsestring_6,
530 attribute => 'String',
533 'sub_arg_definition' => {
534 callback => \&parsesub_arg_definition,
535 attribute => 'Normal Text',
536 fallthrough => '#pop#pop',
539 callback => \&parsesub_name_def,
540 attribute => 'Normal Text',
541 lineending => '#pop',
542 fallthrough => '#pop',
544 'subst_bracket_pattern' => {
545 callback => \&parsesubst_bracket_pattern,
546 attribute => 'Pattern',
548 'subst_bracket_replace' => {
549 callback => \&parsesubst_bracket_replace,
550 attribute => 'String (interpolated)',
552 'subst_curlybrace_middle' => {
553 callback => \&parsesubst_curlybrace_middle,
554 attribute => 'Normal Text',
556 'subst_curlybrace_pattern' => {
557 callback => \&parsesubst_curlybrace_pattern,
558 attribute => 'Pattern',
560 'subst_curlybrace_replace' => {
561 callback => \&parsesubst_curlybrace_replace,
562 attribute => 'String (interpolated)',
564 'subst_curlybrace_replace_recursive' => {
565 callback => \&parsesubst_curlybrace_replace_recursive,
566 attribute => 'String (interpolated)',
568 'subst_paren_pattern' => {
569 callback => \&parsesubst_paren_pattern,
570 attribute => 'Pattern',
572 'subst_paren_replace' => {
573 callback => \&parsesubst_paren_replace,
574 attribute => 'String (interpolated)',
576 'subst_slash_pattern' => {
577 callback => \&parsesubst_slash_pattern,
578 attribute => 'Pattern',
581 'subst_slash_replace' => {
582 callback => \&parsesubst_slash_replace,
583 attribute => 'String (interpolated)',
586 'subst_sq_pattern' => {
587 callback => \&parsesubst_sq_pattern,
588 attribute => 'Pattern',
590 'subst_sq_replace' => {
591 callback => \&parsesubst_sq_replace,
592 attribute => 'String',
595 callback => \&parsetr,
596 attribute => 'Pattern',
597 lineending => '#pop',
598 fallthrough => '#pop',
601 callback => \&parsevar_detect,
602 attribute => 'Data Type',
603 lineending => '#pop#pop',
604 fallthrough => '#pop#pop',
606 'var_detect_rules' => {
607 callback => \&parsevar_detect_rules,
608 attribute => 'Data Type',
609 lineending => '#pop#pop',
611 'var_detect_unsafe' => {
612 callback => \&parsevar_detect_unsafe,
613 attribute => 'Data Type',
614 lineending => '#pop#pop',
615 fallthrough => '#pop#pop',
618 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
619 $self->basecontext('normal');
620 $self->keywordscase(0);
622 bless ($self, $class);
630 sub parseBackticked {
631 my ($self, $text) = @_;
632 # context => 'ipstring_internal'
633 # type => 'IncludeRules'
634 if ($self->includeRules('ipstring_internal', $text)) {
637 # attribute => 'Operator'
640 # type => 'DetectChar'
641 if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
648 my ($self, $text) = @_;
649 # type => 'DetectSpaces'
650 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
653 # context => '##Alerts'
654 # type => 'IncludeRules'
655 if ($self->includePlugin('Alerts', $text)) {
658 # type => 'DetectIdentifier'
659 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
665 sub parsedata_handle {
666 my ($self, $text) = @_;
667 # String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s+.*'
669 # beginRegion => 'POD'
673 if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s+.*', 0, 0, 0, 0, 0, 'pod', 'Pod')) {
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')) {
687 sub parseend_handle {
688 my ($self, $text) = @_;
689 # String => '^\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*'
693 if ($self->testRegExpr($text, '^\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s*.*', 0, 0, 0, undef, 0, 'pod', 'Pod')) {
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')) {
707 sub parsefind_here_document {
708 my ($self, $text) = @_;
709 # String => '(\w+)\s*;?'
710 # attribute => 'Keyword'
711 # context => 'here_document'
713 if ($self->testRegExpr($text, '(\\w+)\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) {
716 # String => '\s*"([^"]+)"\s*;?'
717 # attribute => 'Keyword'
718 # context => 'here_document'
720 if ($self->testRegExpr($text, '\\s*"([^"]+)"\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) {
723 # String => '\s*`([^`]+)`\s*;?'
724 # attribute => 'Keyword'
725 # context => 'here_document'
727 if ($self->testRegExpr($text, '\\s*`([^`]+)`\\s*;?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) {
730 # String => '\s*'([^']+)'\s*;?'
731 # attribute => 'Keyword'
732 # context => 'here_document_dumb'
734 if ($self->testRegExpr($text, '\\s*\'([^\']+)\'\\s*;?', 0, 0, 0, undef, 0, 'here_document_dumb', 'Keyword')) {
740 sub parsefind_pattern {
741 my ($self, $text) = @_;
743 # attribute => 'Comment'
746 if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
749 # attribute => 'Operator'
750 # beginRegion => 'Pattern'
752 # context => 'pattern_brace'
753 # type => 'DetectChar'
754 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'pattern_brace', 'Operator')) {
757 # attribute => 'Operator'
758 # beginRegion => 'Pattern'
760 # context => 'pattern_paren'
761 # type => 'DetectChar'
762 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'pattern_paren', 'Operator')) {
765 # attribute => 'Operator'
766 # beginRegion => 'Pattern'
768 # context => 'pattern_bracket'
769 # type => 'DetectChar'
770 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'pattern_bracket', 'Operator')) {
773 # attribute => 'Operator'
774 # beginRegion => 'Pattern'
776 # context => 'pattern_sq'
777 # type => 'DetectChar'
778 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'pattern_sq', 'Operator')) {
781 # String => '([^\w\s])'
782 # attribute => 'Operator'
783 # beginRegion => 'Pattern'
784 # context => 'pattern'
786 if ($self->testRegExpr($text, '([^\\w\\s])', 0, 0, 0, undef, 0, 'pattern', 'Operator')) {
793 my ($self, $text) = @_;
794 # attribute => 'Operator'
795 # beginRegion => 'String'
797 # context => 'ip_string_2'
798 # type => 'DetectChar'
799 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ip_string_2', 'Operator')) {
802 # attribute => 'Operator'
803 # beginRegion => 'String'
805 # context => 'ip_string_3'
806 # type => 'DetectChar'
807 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'ip_string_3', 'Operator')) {
810 # attribute => 'Operator'
811 # beginRegion => 'String'
813 # context => 'ip_string_4'
814 # type => 'DetectChar'
815 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'ip_string_4', 'Operator')) {
818 # attribute => 'Operator'
819 # beginRegion => 'String'
821 # context => 'ip_string_5'
822 # type => 'DetectChar'
823 if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'ip_string_5', 'Operator')) {
826 # String => '([^a-zA-Z0-9_\s[\]{}()])'
827 # attribute => 'Operator'
828 # beginRegion => 'String'
829 # context => 'ip_string_6'
831 if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'ip_string_6', 'Operator')) {
835 # attribute => 'Comment'
838 if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
844 sub parsefind_quoted {
845 my ($self, $text) = @_;
846 # String => 'x\s*(')'
847 # attribute => 'Operator'
848 # beginRegion => 'String'
849 # context => 'string_6'
851 if ($self->testRegExpr($text, 'x\\s*(\')', 0, 0, 0, undef, 0, 'string_6', 'Operator')) {
855 # attribute => 'Operator'
856 # context => 'find_qqx'
858 if ($self->testAnyChar($text, 'qx', 0, 0, undef, 0, 'find_qqx', 'Operator')) {
861 # attribute => 'Operator'
863 # context => 'find_qw'
864 # type => 'DetectChar'
865 if ($self->testDetectChar($text, 'w', 0, 0, 0, undef, 0, 'find_qw', 'Operator')) {
868 # attribute => 'Operator'
869 # beginRegion => 'String'
871 # context => 'string_2'
872 # type => 'DetectChar'
873 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'string_2', 'Operator')) {
876 # attribute => 'Operator'
877 # beginRegion => 'String'
879 # context => 'string_3'
880 # type => 'DetectChar'
881 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'string_3', 'Operator')) {
884 # attribute => 'Operator'
885 # beginRegion => 'String'
887 # context => 'string_4'
888 # type => 'DetectChar'
889 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'string_4', 'Operator')) {
892 # attribute => 'Operator'
893 # beginRegion => 'String'
895 # context => 'string_5'
896 # type => 'DetectChar'
897 if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, 'string_5', 'Operator')) {
900 # String => '([^a-zA-Z0-9_\s[\]{}()])'
901 # attribute => 'Operator'
902 # beginRegion => 'String'
903 # context => 'string_6'
905 if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'string_6', 'Operator')) {
909 # attribute => 'Comment'
912 if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
919 my ($self, $text) = @_;
920 # attribute => 'Operator'
921 # beginRegion => 'Wordlist'
923 # context => 'quote_word_paren'
924 # type => 'DetectChar'
925 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'quote_word_paren', 'Operator')) {
928 # attribute => 'Operator'
929 # beginRegion => 'Wordlist'
931 # context => 'quote_word_brace'
932 # type => 'DetectChar'
933 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'quote_word_brace', 'Operator')) {
936 # attribute => 'Operator'
937 # beginRegion => 'Wordlist'
939 # context => 'quote_word_bracket'
940 # type => 'DetectChar'
941 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'quote_word_bracket', 'Operator')) {
944 # String => '([^a-zA-Z0-9_\s[\]{}()])'
945 # attribute => 'Operator'
946 # beginRegion => 'Wordlist'
947 # context => 'quote_word'
949 if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()])', 0, 0, 0, undef, 0, 'quote_word', 'Operator')) {
953 # attribute => 'Comment'
956 if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
962 sub parsefind_subst {
963 my ($self, $text) = @_;
965 # attribute => 'Comment'
968 if ($self->testRegExpr($text, '\\s+#.*', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
971 # attribute => 'Operator'
972 # beginRegion => 'Pattern'
974 # context => 'subst_curlybrace_pattern'
975 # type => 'DetectChar'
976 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_pattern', 'Operator')) {
979 # attribute => 'Operator'
980 # beginRegion => 'Pattern'
982 # context => 'subst_paren_pattern'
983 # type => 'DetectChar'
984 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'subst_paren_pattern', 'Operator')) {
987 # attribute => 'Operator'
988 # beginRegion => 'Pattern'
990 # context => 'subst_bracket_pattern'
991 # type => 'DetectChar'
992 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'subst_bracket_pattern', 'Operator')) {
995 # attribute => 'Operator'
996 # beginRegion => 'Pattern'
998 # context => 'subst_sq_pattern'
999 # type => 'DetectChar'
1000 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'subst_sq_pattern', 'Operator')) {
1003 # String => '([^\w\s[\]{}()])'
1004 # attribute => 'Operator'
1005 # beginRegion => 'Pattern'
1006 # context => 'subst_slash_pattern'
1008 if ($self->testRegExpr($text, '([^\\w\\s[\\]{}()])', 0, 0, 0, undef, 0, 'subst_slash_pattern', 'Operator')) {
1014 sub parsefind_variable {
1015 my ($self, $text) = @_;
1016 # String => '\$[0-9]+'
1017 # attribute => 'Special Variable'
1018 # context => 'var_detect'
1020 if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) {
1023 # String => '[@\$](?:[\+\-_]\B|ARGV\b|INC\b)'
1024 # attribute => 'Special Variable'
1025 # context => 'var_detect'
1027 if ($self->testRegExpr($text, '[@\\$](?:[\\+\\-_]\\B|ARGV\\b|INC\\b)', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) {
1030 # String => '[%\$](?:INC\b|ENV\b|SIG\b)'
1031 # attribute => 'Special Variable'
1032 # context => 'var_detect'
1034 if ($self->testRegExpr($text, '[%\\$](?:INC\\b|ENV\\b|SIG\\b)', 0, 0, 0, undef, 0, 'var_detect', 'Special Variable')) {
1037 # String => '\$\$[\$\w_]'
1038 # attribute => 'Data Type'
1039 # context => 'var_detect'
1041 if ($self->testRegExpr($text, '\\$\\$[\\$\\w_]', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1044 # String => '\$[#_][\w_]'
1045 # attribute => 'Data Type'
1046 # context => 'var_detect'
1048 if ($self->testRegExpr($text, '\\$[#_][\\w_]', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1052 # attribute => 'Data Type'
1053 # context => 'var_detect'
1055 if ($self->testRegExpr($text, '\\$+::', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1058 # String => '\$[^a-zA-Z0-9\s{][A-Z]?'
1059 # attribute => 'Special Variable'
1060 # context => '#stay'
1062 if ($self->testRegExpr($text, '\\$[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) {
1065 # String => '[\$@%]\{[\w_]+\}'
1066 # attribute => 'Data Type'
1067 # context => 'var_detect'
1069 if ($self->testRegExpr($text, '[\\$@%]\\{[\\w_]+\\}', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1073 # attribute => 'Data Type'
1074 # context => 'var_detect'
1076 if ($self->testAnyChar($text, '$@%', 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1079 # String => '\*[a-zA-Z_]+'
1080 # attribute => 'Data Type'
1081 # context => 'var_detect'
1083 if ($self->testRegExpr($text, '\\*[a-zA-Z_]+', 0, 0, 0, undef, 0, 'var_detect', 'Data Type')) {
1086 # String => '\*[^a-zA-Z0-9\s{][A-Z]?'
1087 # attribute => 'Special Variable'
1088 # context => '#stay'
1090 if ($self->testRegExpr($text, '\\*[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) {
1094 # attribute => 'Operator'
1097 if ($self->testAnyChar($text, '$@%*', 0, 0, undef, 0, '#pop', 'Operator')) {
1103 sub parsefind_variable_unsafe {
1104 my ($self, $text) = @_;
1105 # String => '\$[0-9]+'
1106 # attribute => 'Special Variable'
1107 # context => 'var_detect_unsafe'
1109 if ($self->testRegExpr($text, '\\$[0-9]+', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) {
1112 # String => '[@\$](?:[\+\-_]\B|ARGV\b|INC\b)'
1113 # attribute => 'Special Variable'
1114 # context => 'var_detect_unsafe'
1116 if ($self->testRegExpr($text, '[@\\$](?:[\\+\\-_]\\B|ARGV\\b|INC\\b)', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) {
1119 # String => '[%\$](?:INC\b|ENV\b|SIG\b)'
1120 # attribute => 'Special Variable'
1121 # context => 'var_detect_unsafe'
1123 if ($self->testRegExpr($text, '[%\\$](?:INC\\b|ENV\\b|SIG\\b)', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Special Variable')) {
1126 # String => '\$\$[\$\w_]'
1127 # attribute => 'Data Type'
1128 # context => 'var_detect_unsafe'
1130 if ($self->testRegExpr($text, '\\$\\$[\\$\\w_]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1133 # String => '\$[#_][\w_]'
1134 # attribute => 'Data Type'
1135 # context => 'var_detect_unsafe'
1137 if ($self->testRegExpr($text, '\\$[#_][\\w_]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1141 # attribute => 'Data Type'
1142 # context => 'var_detect_unsafe'
1144 if ($self->testRegExpr($text, '\\$+::', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1147 # String => '\$[^a-zA-Z0-9\s{][A-Z]?'
1148 # attribute => 'Special Variable'
1149 # context => '#stay'
1151 if ($self->testRegExpr($text, '\\$[^a-zA-Z0-9\\s{][A-Z]?', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) {
1154 # String => '[\$@%]\{[\w_]+\}'
1155 # attribute => 'Data Type'
1156 # context => 'var_detect_unsafe'
1158 if ($self->testRegExpr($text, '[\\$@%]\\{[\\w_]+\\}', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1161 # String => '[\$@%]'
1162 # attribute => 'Data Type'
1163 # context => 'var_detect_unsafe'
1165 if ($self->testRegExpr($text, '[\\$@%]', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1169 # attribute => 'Data Type'
1170 # context => 'var_detect_unsafe'
1172 if ($self->testRegExpr($text, '\\*\\w+', 0, 0, 0, undef, 0, 'var_detect_unsafe', 'Data Type')) {
1176 # attribute => 'Operator'
1179 if ($self->testAnyChar($text, '$@%*', 0, 0, undef, 0, '#pop', 'Operator')) {
1185 sub parsehere_document {
1186 my ($self, $text) = @_;
1187 # type => 'DetectSpaces'
1188 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1192 # attribute => 'Keyword'
1194 # context => '#pop#pop'
1196 # endRegion => 'HereDocument'
1198 if ($self->testRegExpr($text, '%1', 0, 1, 0, 0, 0, '#pop#pop', 'Keyword')) {
1201 # String => '\=\s*<<\s*["']?([A-Z0-9_\-]+)["']?'
1202 # attribute => 'Keyword'
1203 # beginRegion => 'HEREDoc'
1204 # context => 'here_document'
1206 if ($self->testRegExpr($text, '\\=\\s*<<\\s*["\']?([A-Z0-9_\\-]+)["\']?', 0, 0, 0, undef, 0, 'here_document', 'Keyword')) {
1209 # context => 'ipstring_internal'
1210 # type => 'IncludeRules'
1211 if ($self->includeRules('ipstring_internal', $text)) {
1217 sub parsehere_document_dumb {
1218 my ($self, $text) = @_;
1219 # type => 'DetectSpaces'
1220 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1224 # attribute => 'Keyword'
1226 # context => '#pop#pop'
1228 # endRegion => 'HereDocument'
1230 if ($self->testRegExpr($text, '%1', 0, 1, 0, 0, 0, '#pop#pop', 'Keyword')) {
1233 # type => 'DetectIdentifier'
1234 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1240 sub parseip_string {
1241 my ($self, $text) = @_;
1242 # attribute => 'Operator'
1245 # endRegion => 'String'
1246 # type => 'DetectChar'
1247 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
1250 # context => 'ipstring_internal'
1251 # type => 'IncludeRules'
1252 if ($self->includeRules('ipstring_internal', $text)) {
1258 sub parseip_string_2 {
1259 my ($self, $text) = @_;
1260 # attribute => 'String (interpolated)'
1263 # context => '#stay'
1264 # type => 'RangeDetect'
1265 if ($self->testRangeDetect($text, '(', ')', 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1268 # attribute => 'Operator'
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')) {
1276 # context => 'ipstring_internal'
1277 # type => 'IncludeRules'
1278 if ($self->includeRules('ipstring_internal', $text)) {
1284 sub parseip_string_3 {
1285 my ($self, $text) = @_;
1286 # attribute => 'String (interpolated)'
1289 # context => '#stay'
1290 # type => 'RangeDetect'
1291 if ($self->testRangeDetect($text, '{', '}', 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1294 # attribute => 'Operator'
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')) {
1302 # context => 'ipstring_internal'
1303 # type => 'IncludeRules'
1304 if ($self->includeRules('ipstring_internal', $text)) {
1310 sub parseip_string_4 {
1311 my ($self, $text) = @_;
1312 # attribute => 'String (interpolated)'
1315 # context => '#stay'
1316 # type => 'RangeDetect'
1317 if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1320 # attribute => 'Operator'
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')) {
1328 # context => 'ipstring_internal'
1329 # type => 'IncludeRules'
1330 if ($self->includeRules('ipstring_internal', $text)) {
1336 sub parseip_string_5 {
1337 my ($self, $text) = @_;
1338 # attribute => 'String (interpolated)'
1341 # context => '#stay'
1342 # type => 'RangeDetect'
1343 if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1346 # attribute => 'Operator'
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')) {
1354 # context => 'ipstring_internal'
1355 # type => 'IncludeRules'
1356 if ($self->includeRules('ipstring_internal', $text)) {
1362 sub parseip_string_6 {
1363 my ($self, $text) = @_;
1365 # attribute => 'String (interpolated)'
1366 # context => '#stay'
1369 if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'String (interpolated)')) {
1372 # attribute => 'Operator'
1374 # context => '#pop#pop#pop'
1376 # endRegion => 'String'
1377 # type => 'DetectChar'
1378 if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1381 # context => 'ipstring_internal'
1382 # type => 'IncludeRules'
1383 if ($self->includeRules('ipstring_internal', $text)) {
1389 sub parseipstring_internal {
1390 my ($self, $text) = @_;
1391 # type => 'DetectIdentifier'
1392 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1395 # String => '\\[UuLlEtnaefr]'
1396 # attribute => 'String Special Character'
1397 # context => '#stay'
1399 if ($self->testRegExpr($text, '\\\\[UuLlEtnaefr]', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
1403 # attribute => 'String (interpolated)'
1404 # context => '#stay'
1406 if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'String (interpolated)')) {
1409 # String => '(?:[\$@]\S|%[\w{])'
1410 # attribute => 'Normal Text'
1411 # context => 'find_variable_unsafe'
1412 # lookAhead => 'true'
1414 if ($self->testRegExpr($text, '(?:[\\$@]\\S|%[\\w{])', 0, 0, 1, undef, 0, 'find_variable_unsafe', 'Normal Text')) {
1421 my ($self, $text) = @_;
1422 # String => '^#!\/.*'
1423 # attribute => 'Keyword'
1424 # context => '#stay'
1426 if ($self->testRegExpr($text, '^#!\\/.*', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
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')) {
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')) {
1445 # String => '\bsub\s+'
1446 # attribute => 'Keyword'
1447 # context => 'sub_name_def'
1449 if ($self->testRegExpr($text, '\\bsub\\s+', 0, 0, 0, undef, 0, 'sub_name_def', 'Keyword')) {
1452 # String => 'keywords'
1453 # attribute => 'Keyword'
1454 # context => '#stay'
1456 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
1459 # String => 'operators'
1460 # attribute => 'Operator'
1461 # context => '#stay'
1463 if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) {
1466 # String => 'functions'
1467 # attribute => 'Function'
1468 # context => '#stay'
1470 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
1473 # String => 'pragmas'
1474 # attribute => 'Pragma'
1475 # context => '#stay'
1477 if ($self->testKeyword($text, 'pragmas', 0, undef, 0, '#stay', 'Pragma')) {
1480 # String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)(\s|$)'
1481 # attribute => 'Pod'
1482 # beginRegion => 'POD'
1486 if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)(\\s|$)', 0, 0, 0, 0, 0, 'pod', 'Pod')) {
1489 # type => 'DetectSpaces'
1490 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1493 # attribute => 'Comment'
1495 # context => 'comment'
1496 # type => 'DetectChar'
1497 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
1500 # attribute => 'Octal'
1501 # context => 'slash_safe_escape'
1503 if ($self->testHlCOct($text, 0, undef, 0, 'slash_safe_escape', 'Octal')) {
1506 # attribute => 'Hex'
1507 # context => 'slash_safe_escape'
1509 if ($self->testHlCHex($text, 0, undef, 0, 'slash_safe_escape', 'Hex')) {
1512 # attribute => 'Float'
1513 # context => 'slash_safe_escape'
1515 if ($self->testFloat($text, 0, undef, 0, 'slash_safe_escape', 'Float')) {
1518 # attribute => 'Decimal'
1519 # context => 'slash_safe_escape'
1521 if ($self->testInt($text, 0, undef, 0, 'slash_safe_escape', 'Decimal')) {
1524 # String => '\\(["'])[^\1]'
1525 # attribute => 'Normal Text'
1526 # context => '#stay'
1528 if ($self->testRegExpr($text, '\\\\(["\'])[^\\1]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1531 # attribute => 'Normal Text'
1534 # context => '#stay'
1535 # type => 'Detect2Chars'
1536 if ($self->testDetect2Chars($text, '&', '\'', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1539 # attribute => 'Operator'
1540 # beginRegion => 'String'
1542 # context => 'ip_string'
1543 # type => 'DetectChar'
1544 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'ip_string', 'Operator')) {
1547 # attribute => 'Operator'
1548 # beginRegion => 'String'
1550 # context => 'string'
1551 # type => 'DetectChar'
1552 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'string', 'Operator')) {
1555 # attribute => 'Operator'
1557 # context => 'Backticked'
1558 # type => 'DetectChar'
1559 if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Backticked', 'Operator')) {
1562 # String => '(?:[$@]\S|%[\w{]|\*[^\d\*{\$@%=(])'
1563 # attribute => 'Normal Text'
1564 # context => 'find_variable'
1565 # lookAhead => 'true'
1567 if ($self->testRegExpr($text, '(?:[$@]\\S|%[\\w{]|\\*[^\\d\\*{\\$@%=(])', 0, 0, 1, undef, 0, 'find_variable', 'Normal Text')) {
1570 # String => '<[A-Z0-9_]+>'
1571 # attribute => 'Keyword'
1572 # context => '#stay'
1574 if ($self->testRegExpr($text, '<[A-Z0-9_]+>', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1577 # String => '\s*<<(?=\w+|\s*["'])'
1578 # attribute => 'Operator'
1579 # beginRegion => 'HereDocument'
1580 # context => 'find_here_document'
1582 if ($self->testRegExpr($text, '\\s*<<(?=\\w+|\\s*["\'])', 0, 0, 0, undef, 0, 'find_here_document', 'Operator')) {
1585 # String => '\s*\}\s*/'
1586 # attribute => 'Normal Text'
1587 # context => '#stay'
1588 # endRegion => 'Block'
1590 if ($self->testRegExpr($text, '\\s*\\}\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1593 # String => '\s*[)]\s*/'
1594 # attribute => 'Normal Text'
1595 # context => '#stay'
1597 if ($self->testRegExpr($text, '\\s*[)]\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1601 # attribute => 'Function'
1602 # context => 'sub_name_def'
1604 if ($self->testRegExpr($text, '\\w+::', 0, 0, 0, undef, 0, 'sub_name_def', 'Function')) {
1607 # String => '\w+[=]'
1608 # attribute => 'Normal Text'
1609 # context => '#stay'
1611 if ($self->testRegExpr($text, '\\w+[=]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1614 # String => '\bq(?=[qwx]?\s*[^\w\s])'
1615 # attribute => 'Operator'
1616 # context => 'find_quoted'
1618 if ($self->testRegExpr($text, '\\bq(?=[qwx]?\\s*[^\\w\\s])', 0, 0, 0, undef, 0, 'find_quoted', 'Operator')) {
1621 # String => '\bs(?=\s*[^\w\s])'
1622 # attribute => 'Operator'
1623 # context => 'find_subst'
1625 if ($self->testRegExpr($text, '\\bs(?=\\s*[^\\w\\s])', 0, 0, 0, undef, 0, 'find_subst', 'Operator')) {
1628 # String => '\b(?:tr|y)\s*(?=[^\w\s\]})])'
1629 # attribute => 'Operator'
1632 if ($self->testRegExpr($text, '\\b(?:tr|y)\\s*(?=[^\\w\\s\\]})])', 0, 0, 0, undef, 0, 'tr', 'Operator')) {
1635 # String => '\b(?:m|qr)(?=\s*[^\w\s\]})])'
1636 # attribute => 'Operator'
1637 # context => 'find_pattern'
1639 if ($self->testRegExpr($text, '\\b(?:m|qr)(?=\\s*[^\\w\\s\\]})])', 0, 0, 0, undef, 0, 'find_pattern', 'Operator')) {
1642 # String => '[\w_]+\s*/'
1643 # attribute => 'Normal Text'
1644 # context => '#stay'
1646 if ($self->testRegExpr($text, '[\\w_]+\\s*/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1649 # String => '[<>"':]/'
1650 # attribute => 'Normal Text'
1651 # context => '#stay'
1653 if ($self->testRegExpr($text, '[<>"\':]/', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1656 # attribute => 'Operator'
1657 # beginRegion => 'Pattern'
1659 # context => 'pattern_slash'
1660 # type => 'DetectChar'
1661 if ($self->testDetectChar($text, '/', 0, 0, 0, undef, 0, 'pattern_slash', 'Operator')) {
1664 # String => '-[rwxoRWXOeszfdlpSbctugkTBMAC]'
1665 # attribute => 'Operator'
1666 # context => '#stay'
1668 if ($self->testRegExpr($text, '-[rwxoRWXOeszfdlpSbctugkTBMAC]', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
1671 # attribute => 'Normal Text'
1672 # beginRegion => 'Block'
1674 # context => '#stay'
1675 # type => 'DetectChar'
1676 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1679 # attribute => 'Normal Text'
1681 # context => '#stay'
1682 # endRegion => 'Block'
1683 # type => 'DetectChar'
1684 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1690 sub parsepackage_qualified_blank {
1691 my ($self, $text) = @_;
1692 # String => '[\w_]+'
1693 # attribute => 'Normal Text'
1696 if ($self->testRegExpr($text, '[\\w_]+', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
1702 sub parsepat_char_class {
1703 my ($self, $text) = @_;
1704 # attribute => 'Pattern Internal Operator'
1706 # context => '#stay'
1707 # type => 'DetectChar'
1708 if ($self->testDetectChar($text, '^', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
1711 # attribute => 'Pattern Character Class'
1714 # context => '#stay'
1715 # type => 'Detect2Chars'
1716 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
1719 # attribute => 'Pattern Character Class'
1722 # context => '#stay'
1723 # type => 'Detect2Chars'
1724 if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
1727 # String => '\[:^?[a-z]+:\]'
1728 # attribute => 'Pattern Character Class'
1729 # context => '#stay'
1731 if ($self->testRegExpr($text, '\\[:^?[a-z]+:\\]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
1734 # attribute => 'Pattern Internal Operator'
1737 # type => 'DetectChar'
1738 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) {
1745 my ($self, $text) = @_;
1746 # String => '\#[^)]*'
1747 # attribute => 'Comment'
1750 if ($self->testRegExpr($text, '\\#[^)]*', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
1753 # String => '[:=!><]+'
1754 # attribute => 'Pattern Internal Operator'
1757 if ($self->testRegExpr($text, '[:=!><]+', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) {
1760 # attribute => 'Pattern Internal Operator'
1763 # type => 'DetectChar'
1764 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Pattern Internal Operator')) {
1771 my ($self, $text) = @_;
1772 # String => '\$(?=%1)'
1773 # attribute => 'Pattern Internal Operator'
1774 # context => '#stay'
1777 if ($self->testRegExpr($text, '\\$(?=%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
1780 # String => '%1[cgimosx]*'
1781 # attribute => 'Operator'
1782 # context => '#pop#pop'
1784 # endRegion => 'Pattern'
1786 if ($self->testRegExpr($text, '%1[cgimosx]*', 0, 1, 0, undef, 0, '#pop#pop', 'Operator')) {
1789 # context => 'regex_pattern_internal_ip'
1790 # type => 'IncludeRules'
1791 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1794 # String => '\$(?=\%1)'
1795 # attribute => 'Pattern Internal Operator'
1796 # context => '#stay'
1799 if ($self->testRegExpr($text, '\\$(?=\\%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
1805 sub parsepattern_brace {
1806 my ($self, $text) = @_;
1807 # String => '\}[cgimosx]*'
1808 # attribute => 'Operator'
1809 # context => '#pop#pop'
1810 # endRegion => 'Pattern'
1812 if ($self->testRegExpr($text, '\\}[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
1815 # context => 'regex_pattern_internal_ip'
1816 # type => 'IncludeRules'
1817 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1823 sub parsepattern_bracket {
1824 my ($self, $text) = @_;
1825 # String => '\][cgimosx]*'
1826 # attribute => 'Operator'
1827 # context => '#pop#pop'
1828 # endRegion => 'Pattern'
1830 if ($self->testRegExpr($text, '\\][cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
1833 # context => 'regex_pattern_internal_ip'
1834 # type => 'IncludeRules'
1835 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1841 sub parsepattern_paren {
1842 my ($self, $text) = @_;
1843 # String => '\)[cgimosx]*'
1844 # attribute => 'Operator'
1845 # context => '#pop#pop'
1846 # endRegion => 'Pattern'
1848 if ($self->testRegExpr($text, '\\)[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
1851 # context => 'regex_pattern_internal_ip'
1852 # type => 'IncludeRules'
1853 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1859 sub parsepattern_slash {
1860 my ($self, $text) = @_;
1861 # String => '\$(?=/)'
1862 # attribute => 'Pattern Internal Operator'
1863 # context => '#stay'
1865 if ($self->testRegExpr($text, '\\$(?=/)', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
1868 # context => 'regex_pattern_internal_ip'
1869 # type => 'IncludeRules'
1870 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
1873 # String => '/[cgimosx]*'
1874 # attribute => 'Operator'
1876 # endRegion => 'Pattern'
1878 if ($self->testRegExpr($text, '/[cgimosx]*', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
1884 sub parsepattern_sq {
1885 my ($self, $text) = @_;
1886 # String => ''[cgimosx]*'
1887 # attribute => 'Operator'
1888 # context => '#pop#pop'
1889 # endRegion => 'Pattern'
1891 if ($self->testRegExpr($text, '\'[cgimosx]*', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
1894 # context => 'regex_pattern_internal'
1895 # type => 'IncludeRules'
1896 if ($self->includeRules('regex_pattern_internal', $text)) {
1903 my ($self, $text) = @_;
1904 # type => 'DetectSpaces'
1905 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1908 # type => 'DetectIdentifier'
1909 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1912 # String => '\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*'
1913 # attribute => 'Pod'
1914 # beginRegion => 'POD'
1916 # context => '#stay'
1917 # endRegion => 'POD'
1919 if ($self->testRegExpr($text, '\\=(?:head[1-6]|over|back|item|for|begin|end|pod)\\s*.*', 0, 0, 0, 0, 0, '#stay', 'Pod')) {
1922 # String => '\=cut.*$'
1923 # attribute => 'Pod'
1926 # endRegion => 'POD'
1928 if ($self->testRegExpr($text, '\\=cut.*$', 0, 0, 0, 0, 0, '#pop', 'Pod')) {
1934 sub parsequote_word {
1935 my ($self, $text) = @_;
1936 # type => 'DetectSpaces'
1937 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1940 # type => 'DetectIdentifier'
1941 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1945 # attribute => 'Normal Text'
1946 # context => '#stay'
1949 if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'Normal Text')) {
1952 # attribute => 'Operator'
1954 # context => '#pop#pop#pop'
1956 # endRegion => 'Wordlist'
1957 # type => 'DetectChar'
1958 if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
1964 sub parsequote_word_brace {
1965 my ($self, $text) = @_;
1966 # type => 'DetectSpaces'
1967 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1970 # type => 'DetectIdentifier'
1971 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
1974 # attribute => 'Normal Text'
1977 # context => '#stay'
1978 # type => 'Detect2Chars'
1979 if ($self->testDetect2Chars($text, '\\', '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1982 # attribute => 'Operator'
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')) {
1993 sub parsequote_word_bracket {
1994 my ($self, $text) = @_;
1995 # type => 'DetectSpaces'
1996 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1999 # type => 'DetectIdentifier'
2000 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2003 # attribute => 'Normal Text'
2006 # context => '#stay'
2007 # type => 'Detect2Chars'
2008 if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2011 # attribute => 'Operator'
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')) {
2022 sub parsequote_word_paren {
2023 my ($self, $text) = @_;
2024 # type => 'DetectSpaces'
2025 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
2028 # type => 'DetectIdentifier'
2029 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2032 # attribute => 'Normal Text'
2035 # context => '#stay'
2036 # type => 'Detect2Chars'
2037 if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2040 # attribute => 'Operator'
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')) {
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)) {
2058 # context => 'regex_pattern_internal_rules_2'
2059 # type => 'IncludeRules'
2060 if ($self->includeRules('regex_pattern_internal_rules_2', $text)) {
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)) {
2073 # String => '[$@][^]\s{}()|>']'
2074 # attribute => 'Data Type'
2075 # context => 'find_variable_unsafe'
2076 # lookAhead => 'true'
2078 if ($self->testRegExpr($text, '[$@][^]\\s{}()|>\']', 0, 0, 1, undef, 0, 'find_variable_unsafe', 'Data Type')) {
2081 # context => 'regex_pattern_internal_rules_2'
2082 # type => 'IncludeRules'
2083 if ($self->includeRules('regex_pattern_internal_rules_2', $text)) {
2089 sub parseregex_pattern_internal_rules_1 {
2090 my ($self, $text) = @_;
2092 # attribute => 'Comment'
2093 # context => '#stay'
2094 # firstNonSpace => 'true'
2096 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 1, '#stay', 'Comment')) {
2099 # String => '\\[anDdSsWw]'
2100 # attribute => 'Pattern Character Class'
2101 # context => '#stay'
2103 if ($self->testRegExpr($text, '\\\\[anDdSsWw]', 0, 0, 0, undef, 0, '#stay', 'Pattern Character Class')) {
2106 # String => '\\[ABbEGLlNUuQdQZz]'
2107 # attribute => 'Pattern Internal Operator'
2108 # context => '#stay'
2110 if ($self->testRegExpr($text, '\\\\[ABbEGLlNUuQdQZz]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2113 # String => '\\[\d]+'
2114 # attribute => 'Special Variable'
2115 # context => '#stay'
2117 if ($self->testRegExpr($text, '\\\\[\\d]+', 0, 0, 0, undef, 0, '#stay', 'Special Variable')) {
2121 # attribute => 'Pattern'
2122 # context => '#stay'
2124 if ($self->testRegExpr($text, '\\\\.', 0, 0, 0, undef, 0, '#stay', 'Pattern')) {
2130 sub parseregex_pattern_internal_rules_2 {
2131 my ($self, $text) = @_;
2132 # attribute => 'Pattern Internal Operator'
2135 # context => 'pat_ext'
2136 # type => 'Detect2Chars'
2137 if ($self->testDetect2Chars($text, '(', '?', 0, 0, 0, undef, 0, 'pat_ext', 'Pattern Internal Operator')) {
2140 # attribute => 'Pattern Internal Operator'
2142 # context => 'pat_char_class'
2143 # type => 'DetectChar'
2144 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'pat_char_class', 'Pattern Internal Operator')) {
2147 # String => '[()?^*+|]'
2148 # attribute => 'Pattern Internal Operator'
2149 # context => '#stay'
2151 if ($self->testRegExpr($text, '[()?^*+|]', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2154 # String => '\{[\d, ]+\}'
2155 # attribute => 'Pattern Internal Operator'
2156 # context => '#stay'
2158 if ($self->testRegExpr($text, '\\{[\\d, ]+\\}', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2161 # attribute => 'Pattern Internal Operator'
2163 # context => '#stay'
2164 # type => 'DetectChar'
2165 if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2168 # String => '\s{3,}#.*$'
2169 # attribute => 'Comment'
2170 # context => '#stay'
2172 if ($self->testRegExpr($text, '\\s{3,}#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2178 sub parseslash_safe_escape {
2179 my ($self, $text) = @_;
2180 # String => '\s*\]?\s*/'
2181 # attribute => 'Normal Text'
2184 if ($self->testRegExpr($text, '\\s*\\]?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
2187 # String => '\s*\}?\s*/'
2188 # attribute => 'Normal Text'
2190 # endRegion => 'Block'
2192 if ($self->testRegExpr($text, '\\s*\\}?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
2195 # String => '\s*\)?\s*/'
2196 # attribute => 'Normal Text'
2199 if ($self->testRegExpr($text, '\\s*\\)?\\s*/', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
2202 # String => 'keywords'
2203 # attribute => 'Keyword'
2206 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#pop', 'Keyword')) {
2213 my ($self, $text) = @_;
2214 # type => 'DetectIdentifier'
2215 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2218 # attribute => 'String Special Character'
2221 # context => '#stay'
2222 # type => 'Detect2Chars'
2223 if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2226 # attribute => 'String Special Character'
2229 # context => '#stay'
2230 # type => 'Detect2Chars'
2231 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2234 # attribute => 'Operator'
2237 # endRegion => 'String'
2238 # type => 'DetectChar'
2239 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
2246 my ($self, $text) = @_;
2247 # type => 'DetectIdentifier'
2248 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2251 # attribute => 'String Special Character'
2254 # context => '#stay'
2255 # type => 'Detect2Chars'
2256 if ($self->testDetect2Chars($text, '\\', ')', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2259 # attribute => 'String Special Character'
2262 # context => '#stay'
2263 # type => 'Detect2Chars'
2264 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2267 # attribute => 'String'
2270 # context => '#stay'
2271 # type => 'RangeDetect'
2272 if ($self->testRangeDetect($text, '(', ')', 0, 0, undef, 0, '#stay', 'String')) {
2275 # attribute => 'Operator'
2277 # context => '#pop#pop'
2278 # endRegion => 'String'
2279 # type => 'DetectChar'
2280 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
2287 my ($self, $text) = @_;
2288 # type => 'DetectIdentifier'
2289 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2292 # attribute => 'String Special Character'
2295 # context => '#stay'
2296 # type => 'Detect2Chars'
2297 if ($self->testDetect2Chars($text, '\\', '}', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2300 # attribute => 'String Special Character'
2303 # context => '#stay'
2304 # type => 'Detect2Chars'
2305 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2308 # attribute => 'String'
2311 # context => '#stay'
2312 # type => 'RangeDetect'
2313 if ($self->testRangeDetect($text, '{', '}', 0, 0, undef, 0, '#stay', 'String')) {
2316 # attribute => 'Operator'
2318 # context => '#pop#pop'
2319 # endRegion => 'String'
2320 # type => 'DetectChar'
2321 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
2328 my ($self, $text) = @_;
2329 # type => 'DetectIdentifier'
2330 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2333 # attribute => 'String Special Character'
2336 # context => '#stay'
2337 # type => 'Detect2Chars'
2338 if ($self->testDetect2Chars($text, '\\', ']', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2341 # attribute => 'String Special Character'
2344 # context => '#stay'
2345 # type => 'Detect2Chars'
2346 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2349 # attribute => 'String'
2352 # context => '#stay'
2353 # type => 'RangeDetect'
2354 if ($self->testRangeDetect($text, '[', ']', 0, 0, undef, 0, '#stay', 'String')) {
2357 # attribute => 'Operator'
2359 # context => '#pop#pop'
2360 # endRegion => 'String'
2361 # type => 'DetectChar'
2362 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
2369 my ($self, $text) = @_;
2370 # type => 'DetectIdentifier'
2371 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2374 # attribute => 'String Special Character'
2377 # context => '#stay'
2378 # type => 'Detect2Chars'
2379 if ($self->testDetect2Chars($text, '\\', '<', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2382 # attribute => 'String Special Character'
2385 # context => '#stay'
2386 # type => 'Detect2Chars'
2387 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2390 # attribute => 'String'
2393 # context => '#stay'
2394 # type => 'Detect2Chars'
2395 if ($self->testDetect2Chars($text, '\\', '>', 0, 0, 0, undef, 0, '#stay', 'String')) {
2398 # attribute => 'String'
2401 # context => '#stay'
2402 # type => 'RangeDetect'
2403 if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'String')) {
2406 # attribute => 'Operator'
2408 # context => '#pop#pop'
2409 # endRegion => 'String'
2410 # type => 'DetectChar'
2411 if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
2418 my ($self, $text) = @_;
2419 # type => 'DetectIdentifier'
2420 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
2423 # attribute => 'String Special Character'
2426 # context => '#stay'
2427 # type => 'Detect2Chars'
2428 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String Special Character')) {
2432 # attribute => 'String Special Character'
2433 # context => '#stay'
2436 if ($self->testRegExpr($text, '\\\\%1', 0, 1, 0, undef, 0, '#stay', 'String Special Character')) {
2439 # attribute => 'Operator'
2441 # context => '#pop#pop'
2443 # endRegion => 'String'
2444 # type => 'DetectChar'
2445 if ($self->testDetectChar($text, '1', 0, 1, 0, undef, 0, '#pop#pop', 'Operator')) {
2451 sub parsesub_arg_definition {
2452 my ($self, $text) = @_;
2454 # attribute => 'Data Type'
2455 # context => '#stay'
2457 if ($self->testAnyChar($text, '*$@%', 0, 0, undef, 0, '#stay', 'Data Type')) {
2461 # attribute => 'Normal Text'
2462 # context => '#stay'
2464 if ($self->testAnyChar($text, '&\\[];', 0, 0, undef, 0, '#stay', 'Normal Text')) {
2467 # attribute => 'Normal Text'
2469 # context => 'slash_safe_escape'
2470 # type => 'DetectChar'
2471 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, 'slash_safe_escape', 'Normal Text')) {
2477 sub parsesub_name_def {
2478 my ($self, $text) = @_;
2480 # attribute => 'Function'
2481 # context => '#stay'
2483 if ($self->testRegExpr($text, '\\w+', 0, 0, 0, undef, 0, '#stay', 'Function')) {
2487 # attribute => 'Normal Text'
2488 # context => 'find_variable'
2489 # lookAhead => 'true'
2491 if ($self->testRegExpr($text, '\\$\\S', 0, 0, 1, undef, 0, 'find_variable', 'Normal Text')) {
2495 # attribute => 'Normal Text'
2496 # context => 'sub_arg_definition'
2498 if ($self->testRegExpr($text, '\\s*\\(', 0, 0, 0, undef, 0, 'sub_arg_definition', 'Normal Text')) {
2501 # attribute => 'Normal Text'
2504 # context => '#stay'
2505 # type => 'Detect2Chars'
2506 if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2512 sub parsesubst_bracket_pattern {
2513 my ($self, $text) = @_;
2514 # String => '\s+#.*$'
2515 # attribute => 'Comment'
2516 # context => '#stay'
2518 if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2521 # context => 'regex_pattern_internal_ip'
2522 # type => 'IncludeRules'
2523 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
2526 # attribute => 'Operator'
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')) {
2537 sub parsesubst_bracket_replace {
2538 my ($self, $text) = @_;
2539 # context => 'ipstring_internal'
2540 # type => 'IncludeRules'
2541 if ($self->includeRules('ipstring_internal', $text)) {
2544 # attribute => 'Operator'
2545 # beginRegion => 'Replacement'
2547 # context => '#stay'
2548 # type => 'DetectChar'
2549 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2552 # String => '\][cegimosx]*'
2553 # attribute => 'Operator'
2554 # context => '#pop#pop#pop'
2555 # endRegion => 'Replacement'
2557 if ($self->testRegExpr($text, '\\][cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2563 sub parsesubst_curlybrace_middle {
2564 my ($self, $text) = @_;
2566 # attribute => 'Comment'
2567 # context => '#stay'
2569 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2572 # attribute => 'Operator'
2573 # beginRegion => 'Replacement'
2575 # context => 'subst_curlybrace_replace'
2576 # type => 'DetectChar'
2577 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, 'subst_curlybrace_replace', 'Operator')) {
2583 sub parsesubst_curlybrace_pattern {
2584 my ($self, $text) = @_;
2585 # String => '\s+#.*$'
2586 # attribute => 'Comment'
2587 # context => '#stay'
2589 if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2592 # context => 'regex_pattern_internal_ip'
2593 # type => 'IncludeRules'
2594 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
2597 # attribute => 'Operator'
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')) {
2608 sub parsesubst_curlybrace_replace {
2609 my ($self, $text) = @_;
2610 # context => 'ipstring_internal'
2611 # type => 'IncludeRules'
2612 if ($self->includeRules('ipstring_internal', $text)) {
2615 # attribute => 'Normal Text'
2616 # beginRegion => 'Block'
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')) {
2623 # String => '\}[cegimosx]*'
2624 # attribute => 'Operator'
2625 # context => '#pop#pop#pop#pop'
2626 # endRegion => 'Replacement'
2628 if ($self->testRegExpr($text, '\\}[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop#pop', 'Operator')) {
2634 sub parsesubst_curlybrace_replace_recursive {
2635 my ($self, $text) = @_;
2636 # attribute => 'String (interpolated)'
2637 # beginRegion => 'Block'
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)')) {
2644 # attribute => 'Normal Text'
2647 # endRegion => 'Block'
2648 # type => 'DetectChar'
2649 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
2652 # context => 'ipstring_internal'
2653 # type => 'IncludeRules'
2654 if ($self->includeRules('ipstring_internal', $text)) {
2660 sub parsesubst_paren_pattern {
2661 my ($self, $text) = @_;
2662 # String => '\s+#.*$'
2663 # attribute => 'Comment'
2664 # context => '#stay'
2666 if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2669 # context => 'regex_pattern_internal_ip'
2670 # type => 'IncludeRules'
2671 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
2674 # attribute => 'Operator'
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')) {
2685 sub parsesubst_paren_replace {
2686 my ($self, $text) = @_;
2687 # context => 'ipstring_internal'
2688 # type => 'IncludeRules'
2689 if ($self->includeRules('ipstring_internal', $text)) {
2692 # attribute => 'Operator'
2693 # beginRegion => 'Replacement'
2695 # context => '#stay'
2696 # type => 'DetectChar'
2697 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2700 # String => '\)[cegimosx]*'
2701 # attribute => 'Operator'
2702 # context => '#pop#pop#pop'
2703 # endRegion => 'Replacement'
2705 if ($self->testRegExpr($text, '\\)[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2711 sub parsesubst_slash_pattern {
2712 my ($self, $text) = @_;
2713 # String => '\$(?=%1)'
2714 # attribute => 'Pattern Internal Operator'
2715 # context => '#stay'
2718 if ($self->testRegExpr($text, '\\$(?=%1)', 0, 1, 0, undef, 0, '#stay', 'Pattern Internal Operator')) {
2722 # attribute => 'Operator'
2723 # beginRegion => 'Replacement'
2724 # context => 'subst_slash_replace'
2726 # endRegion => 'Pattern'
2728 if ($self->testRegExpr($text, '(%1)', 0, 1, 0, undef, 0, 'subst_slash_replace', 'Operator')) {
2731 # context => 'regex_pattern_internal_ip'
2732 # type => 'IncludeRules'
2733 if ($self->includeRules('regex_pattern_internal_ip', $text)) {
2739 sub parsesubst_slash_replace {
2740 my ($self, $text) = @_;
2741 # context => 'ipstring_internal'
2742 # type => 'IncludeRules'
2743 if ($self->includeRules('ipstring_internal', $text)) {
2746 # String => '%1[cegimosx]*'
2747 # attribute => 'Operator'
2748 # context => '#pop#pop#pop'
2750 # endRegion => 'Replacement'
2752 if ($self->testRegExpr($text, '%1[cegimosx]*', 0, 1, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2758 sub parsesubst_sq_pattern {
2759 my ($self, $text) = @_;
2760 # String => '\s+#.*$'
2761 # attribute => 'Comment'
2762 # context => '#stay'
2764 if ($self->testRegExpr($text, '\\s+#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
2767 # context => 'regex_pattern_internal'
2768 # type => 'IncludeRules'
2769 if ($self->includeRules('regex_pattern_internal', $text)) {
2772 # attribute => 'Operator'
2773 # beginRegion => 'Pattern'
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')) {
2784 sub parsesubst_sq_replace {
2785 my ($self, $text) = @_;
2786 # String => ''[cegimosx]*'
2787 # attribute => 'Operator'
2788 # context => '#pop#pop#pop'
2789 # endRegion => 'Replacement'
2791 if ($self->testRegExpr($text, '\'[cegimosx]*', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Operator')) {
2798 my ($self, $text) = @_;
2799 # String => '\([^)]*\)\s*\(?:[^)]*\)'
2800 # attribute => 'Pattern'
2803 if ($self->testRegExpr($text, '\\([^)]*\\)\\s*\\(?:[^)]*\\)', 0, 0, 0, undef, 0, '#pop', 'Pattern')) {
2806 # String => '\{[^}]*\}\s*\{[^}]*\}'
2807 # attribute => 'Pattern'
2810 if ($self->testRegExpr($text, '\\{[^}]*\\}\\s*\\{[^}]*\\}', 0, 0, 0, undef, 0, '#pop', 'Pattern')) {
2813 # String => '\[[^}]*\]\s*\[[^\]]*\]'
2814 # attribute => 'Pattern'
2817 if ($self->testRegExpr($text, '\\[[^}]*\\]\\s*\\[[^\\]]*\\]', 0, 0, 0, undef, 0, '#pop', 'Pattern')) {
2820 # String => '([^a-zA-Z0-9_\s[\]{}()]).*\1.*\1'
2821 # attribute => 'Pattern'
2825 if ($self->testRegExpr($text, '([^a-zA-Z0-9_\\s[\\]{}()]).*?\\1.*?\\1', 0, 0, 0, undef, 0, '#pop', 'Pattern')) {
2831 sub parsevar_detect {
2832 my ($self, $text) = @_;
2833 # context => 'var_detect_rules'
2834 # type => 'IncludeRules'
2835 if ($self->includeRules('var_detect_rules', $text)) {
2838 # context => 'slash_safe_escape'
2839 # type => 'IncludeRules'
2840 if ($self->includeRules('slash_safe_escape', $text)) {
2846 sub parsevar_detect_rules {
2847 my ($self, $text) = @_;
2848 # String => '[\w_]+'
2849 # attribute => 'Data Type'
2850 # context => '#stay'
2852 if ($self->testRegExpr($text, '[\\w_]+', 0, 0, 0, undef, 0, '#stay', 'Data Type')) {
2855 # attribute => 'Normal Text'
2858 # context => '#stay'
2859 # type => 'Detect2Chars'
2860 if ($self->testDetect2Chars($text, ':', ':', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2863 # attribute => 'Operator'
2865 # context => '#stay'
2866 # type => 'DetectChar'
2867 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
2870 # attribute => 'Normal Text'
2873 # context => '#stay'
2874 # type => 'Detect2Chars'
2875 if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2878 # attribute => 'Normal Text'
2881 # context => '#stay'
2882 # type => 'Detect2Chars'
2883 if ($self->testDetect2Chars($text, '+', '+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2886 # attribute => 'Normal Text'
2889 # context => '#stay'
2890 # type => 'Detect2Chars'
2891 if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
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)) {
2914 Syntax::Highlight::Engine::Kate::Perl - a Plugin for Perl syntax highlighting
2918 require Syntax::Highlight::Engine::Kate::Perl;
2919 my $sh = new Syntax::Highlight::Engine::Kate::Perl([
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.
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.
2931 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
2937 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
2943 Unknown. If you find any, please contact the author