| Server IP : 162.214.74.102 / Your IP : 216.73.216.139 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/perl-Regexp-Assemble-0.35/eg/ |
Upload File : |
/usr/bin/perl -w
#
# naive - generate a regular expression that will lex regular expressions
# it is naive in the sense that it can't lex certain patterns, such as a
# pattern that contains nested parentheses (e.g. /ab(?:cd(?ef)?gh)+ij/ )
#
# The emitted regular expression is the default pattern that Regexp::Assemble
# uses to pick apart a string into tokens suitable for being assembled. If it
# isn't sufficiently sophisticated, you will have to supply your own lexer.
#
# Copyright (C) David Landgren 2004-2005
use strict;
my $directive = q{[bABCEGLQUXZ]};
my $punct = q{[^\\w]};
my $meta = q{[aefnrtdDwWsS]};
my $ctrl = q{c.};
my $octal = q{0\\d{2}};
my $hex = q{x(?:[\\da-fA-F]{2}|{[\\da-fA-F]{4}})};
my $named = q{N\\{\w+\\}};
my $prop = q{[Pp](?:\\{\w+\\}|.)};
my $single = q{[^\\w\\/{|}-]};
my $modifiable = qq{$punct|$meta|$ctrl|$octal|$hex|$named|$prop};
my $modifier = q{(?:[*+?]\\??|\\{\\d+(?:,\\d*)?\\}\\??)?};
my $backslash = qq{\\\\(?:$directive|[lu].|(?:$modifiable)$modifier)};
my $class = q{\\[.*?(?<!\\\\)\\]};
my $group = q{\\(.*?(?<!\\\\)\\)};
# \$Default_Lexer = qr/(?![[(\\\\]).$modifier|$backslash|$class$modifier|$group$modifier/;
print <<PATTS;
# The following patterns were generated with eg/naive
\$Default_Lexer = qr/(?![[(\\\\]).$modifier|$backslash|$class$modifier|$group$modifier/;
\$Single_Char = qr/^(?:\\\\(?:$meta|$ctrl|$single|$octal|$hex)|[^\$^])\$/;
PATTS
# my brain hurts just looking at this