ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- PK] $ ugug Common.pmnu6$package Regexp::Common; use 5.10.0; use strict; use warnings; no warnings 'syntax'; our $VERSION = '2024080801'; our %RE; our %sub_interface; our $AUTOLOAD; sub _croak { require Carp; goto &Carp::croak; } sub _carp { require Carp; goto &Carp::carp; } sub new { my ($class, @data) = @_; my %self; tie %self, $class, @data; return \%self; } sub TIEHASH { my ($class, @data) = @_; bless \@data, $class; } sub FETCH { my ($self, $extra) = @_; return bless ref($self)->new(@$self, $extra), ref($self); } my %imports = map {$_ => "Regexp::Common::$_"} qw /balanced CC comment delimited lingua list net number profanity SEN URI whitespace zip/; sub import { shift; # Shift off the class. tie %RE, __PACKAGE__; { no strict 'refs'; *{caller() . "::RE"} = \%RE; } my $saw_import; my $no_defaults; my %exclude; foreach my $entry (grep {!/^RE_/} @_) { if ($entry eq 'pattern') { no strict 'refs'; *{caller() . "::pattern"} = \&pattern; next; } # This used to prevent $; from being set. We still recognize it, # but we won't do anything. if ($entry eq 'clean') { next; } if ($entry eq 'no_defaults') { $no_defaults ++; next; } if (my $module = $imports {$entry}) { $saw_import ++; eval "require $module;"; die $@ if $@; next; } if ($entry =~ /^!(.*)/ && $imports {$1}) { $exclude {$1} ++; next; } # As a last resort, try to load the argument. my $module = $entry =~ /^Regexp::Common/ ? $entry : "Regexp::Common::" . $entry; eval "require $module;"; die $@ if $@; } unless ($saw_import || $no_defaults) { foreach my $module (values %imports) { next if $exclude {$module}; eval "require $module;"; die $@ if $@; } } my %exported; foreach my $entry (grep {/^RE_/} @_) { if ($entry =~ /^RE_(\w+_)?ALL$/) { my $m = defined $1 ? $1 : ""; my $re = qr /^RE_${m}.*$/; while (my ($sub, $interface) = each %sub_interface) { next if $exported {$sub}; next unless $sub =~ /$re/; { no strict 'refs'; *{caller() . "::$sub"} = $interface; } $exported {$sub} ++; } } else { next if $exported {$entry}; _croak "Can't export unknown subroutine &$entry" unless $sub_interface {$entry}; { no strict 'refs'; *{caller() . "::$entry"} = $sub_interface {$entry}; } $exported {$entry} ++; } } } sub AUTOLOAD { _croak "Can't $AUTOLOAD" } sub DESTROY {} my %cache; my $fpat = qr/^(-\w+)/; sub _decache { my @args = @{tied %{$_[0]}}; my @nonflags = grep {!/$fpat/} @args; my $cache = get_cache(@nonflags); _croak "Can't create unknown regex: \$RE{" . join("}{",@args) . "}" unless exists $cache->{__VAL__}; _croak "Perl $] does not support the pattern " . "\$RE{" . join("}{",@args) . "}.\nYou need Perl $cache->{__VAL__}{version} or later" unless ($cache->{__VAL__}{version}||0) <= $]; my %flags = ( %{$cache->{__VAL__}{default}}, map { /$fpat\Q$;\E(.*)/ ? ($1 => $2) : /$fpat/ ? ($1 => undef) : () } @args); $cache->{__VAL__}->_clone_with(\@args, \%flags); } use overload q{""} => \&_decache; sub get_cache { my $cache = \%cache; foreach (@_) { $cache = $cache->{$_} || ($cache->{$_} = {}); } return $cache; } sub croak_version { my ($entry, @args) = @_; } sub pattern { my %spec = @_; _croak 'pattern() requires argument: name => [ @list ]' unless $spec{name} && ref $spec{name} eq 'ARRAY'; _croak 'pattern() requires argument: create => $sub_ref_or_string' unless $spec{create}; if (ref $spec{create} ne "CODE") { my $fixed_str = "$spec{create}"; $spec{create} = sub { $fixed_str } } my @nonflags; my %default; foreach ( @{$spec{name}} ) { if (/$fpat=(.*)/) { $default{$1} = $2; } elsif (/$fpat\s*$/) { $default{$1} = undef; } else { push @nonflags, $_; } } my $entry = get_cache(@nonflags); if ($entry->{__VAL__}) { _carp "Overriding \$RE{" . join("}{",@nonflags) . "}"; } $entry->{__VAL__} = bless { create => $spec{create}, match => $spec{match} || \&generic_match, subs => $spec{subs} || \&generic_subs, version => $spec{version}, default => \%default, }, 'Regexp::Common::Entry'; foreach (@nonflags) {s/\W/X/g} my $subname = "RE_" . join ("_", @nonflags); $sub_interface{$subname} = sub { push @_ => undef if @_ % 2; my %flags = @_; my $pat = $spec{create}->($entry->{__VAL__}, {%default, %flags}, \@nonflags); if (exists $flags{-keep}) { $pat =~ s/\Q(?k:/(/g; } else { $pat =~ s/\Q(?k:/(?:/g; } return exists $flags {-i} ? qr /(?i:$pat)/ : qr/$pat/; }; return 1; } sub generic_match {$_ [1] =~ /$_[0]/} sub generic_subs {$_ [1] =~ s/$_[0]/$_[2]/} sub matches { my ($self, $str) = @_; my $entry = $self -> _decache; $entry -> {match} -> ($entry, $str); } sub subs { my ($self, $str, $newstr) = @_; my $entry = $self -> _decache; $entry -> {subs} -> ($entry, $str, $newstr); return $str; } package Regexp::Common::Entry; # use Carp; use overload q{""} => sub { my ($self) = @_; my $pat = $self->{create}->($self, $self->{flags}, $self->{args}); if (exists $self->{flags}{-keep}) { $pat =~ s/\Q(?k:/(/g; } else { $pat =~ s/\Q(?k:/(?:/g; } if (exists $self->{flags}{-i}) { $pat = "(?i)$pat" } return $pat; }; sub _clone_with { my ($self, $args, $flags) = @_; bless { %$self, args=>$args, flags=>$flags }, ref $self; } 1; __END__ =pod =head1 NAME Regexp::Common - Provide commonly requested regular expressions =head1 SYNOPSIS # STANDARD USAGE use Regexp::Common; while (<>) { /$RE{num}{real}/ and print q{a number}; /$RE{quoted}/ and print q{a ['"`] quoted string}; m[$RE{delimited}{-delim=>'/'}] and print q{a /.../ sequence}; /$RE{balanced}{-parens=>'()'}/ and print q{balanced parentheses}; /$RE{profanity}/ and print q{a #*@%-ing word}; } # SUBROUTINE-BASED INTERFACE use Regexp::Common 'RE_ALL'; while (<>) { $_ =~ RE_num_real() and print q{a number}; $_ =~ RE_quoted() and print q{a ['"`] quoted string}; $_ =~ RE_delimited(-delim=>'/') and print q{a /.../ sequence}; $_ =~ RE_balanced(-parens=>'()'} and print q{balanced parentheses}; $_ =~ RE_profanity() and print q{a #*@%-ing word}; } # IN-LINE MATCHING... if ( $RE{num}{int}->matches($text) ) {...} # ...AND SUBSTITUTION my $cropped = $RE{ws}{crop}->subs($uncropped); # ROLL-YOUR-OWN PATTERNS use Regexp::Common 'pattern'; pattern name => ['name', 'mine'], create => '(?i:J[.]?\s+A[.]?\s+Perl-Hacker)', ; my $name_matcher = $RE{name}{mine}; pattern name => [ 'lineof', '-char=_' ], create => sub { my $flags = shift; my $char = quotemeta $flags->{-char}; return '(?:^$char+$)'; }, match => sub { my ($self, $str) = @_; return $str !~ /[^$self->{flags}{-char}]/; }, subs => sub { my ($self, $str, $replacement) = @_; $_[1] =~ s/^$self->{flags}{-char}+$//g; }, ; my $asterisks = $RE{lineof}{-char=>'*'}; # DECIDING WHICH PATTERNS TO LOAD. use Regexp::Common qw /comment number/; # Comment and number patterns. use Regexp::Common qw /no_defaults/; # Don't load any patterns. use Regexp::Common qw /!delimited/; # All, but delimited patterns. =head1 DESCRIPTION By default, this module exports a single hash (C<%RE>) that stores or generates commonly needed regular expressions (see L<"List of available patterns">). There is an alternative, subroutine-based syntax described in L<"Subroutine-based interface">. =head2 General syntax for requesting patterns To access a particular pattern, C<%RE> is treated as a hierarchical hash of hashes (of hashes...), with each successive key being an identifier. For example, to access the pattern that matches real numbers, you specify: $RE{num}{real} and to access the pattern that matches integers: $RE{num}{int} Deeper layers of the hash are used to specify I: arguments that modify the resulting pattern in some way. The keys used to access these layers are prefixed with a minus sign and may have a value; if a value is given, it's done by using a multidimensional key. For example, to access the pattern that matches base-2 real numbers with embedded commas separating groups of three digits (e.g. 10,101,110.110101101): $RE{num}{real}{-base => 2}{-sep => ','}{-group => 3} Through the magic of Perl, these flag layers may be specified in any order (and even interspersed through the identifier keys!) so you could get the same pattern with: $RE{num}{real}{-sep => ','}{-group => 3}{-base => 2} or: $RE{num}{-base => 2}{real}{-group => 3}{-sep => ','} or even: $RE{-base => 2}{-group => 3}{-sep => ','}{num}{real} etc. Note, however, that the relative order of amongst the identifier keys I significant. That is: $RE{list}{set} would not be the same as: $RE{set}{list} =head2 Flag syntax In versions prior to 2.113, flags could also be written as C<{"-flag=value"}>. This no longer works, although C<{"-flag$;value"}> still does. However, C<< {-flag => 'value'} >> is the preferred syntax. =head2 Universal flags Normally, flags are specific to a single pattern. However, there is two flags that all patterns may specify. =over 4 =item C<-keep> By default, the patterns provided by C<%RE> contain no capturing parentheses. However, if the C<-keep> flag is specified (it requires no value) then any significant substrings that the pattern matches are captured. For example: if ($str =~ $RE{num}{real}{-keep}) { $number = $1; $whole = $3; $decimals = $5; } Special care is needed if a "kept" pattern is interpolated into a larger regular expression, as the presence of other capturing parentheses is likely to change the "number variables" into which significant substrings are saved. See also L<"Adding new regular expressions">, which describes how to create new patterns with "optional" capturing brackets that respond to C<-keep>. =item C<-i> Some patterns or subpatterns only match lowercase or uppercase letters. If one wants the do case insensitive matching, one option is to use the C regexp modifier, or the special sequence C<(?i)>. But if the functional interface is used, one does not have this option. The C<-i> switch solves this problem; by using it, the pattern will do case insensitive matching. =back =head2 OO interface and inline matching/substitution The patterns returned from C<%RE> are objects, so rather than writing: if ($str =~ /$RE{some}{pattern}/ ) {...} you can write: if ( $RE{some}{pattern}->matches($str) ) {...} For matching this would seem to have no great advantage apart from readability (but see below). For substitutions, it has other significant benefits. Frequently you want to perform a substitution on a string without changing the original. Most people use this: $changed = $original; $changed =~ s/$RE{some}{pattern}/$replacement/; The more adept use: ($changed = $original) =~ s/$RE{some}{pattern}/$replacement/; Regexp::Common allows you do write this: $changed = $RE{some}{pattern}->subs($original=>$replacement); Apart from reducing precedence-angst, this approach has the added advantages that the substitution behaviour can be optimized from the regular expression, and the replacement string can be provided by default (see L<"Adding new regular expressions">). For example, in the implementation of this substitution: $cropped = $RE{ws}{crop}->subs($uncropped); the default empty string is provided automatically, and the substitution is optimized to use: $uncropped =~ s/^\s+//; $uncropped =~ s/\s+$//; rather than: $uncropped =~ s/^\s+|\s+$//g; =head2 Subroutine-based interface The hash-based interface was chosen because it allows regexes to be effortlessly interpolated, and because it also allows them to be "curried". For example: my $num = $RE{num}{int}; my $commad = $num->{-sep=>','}{-group=>3}; my $duodecimal = $num->{-base=>12}; However, the use of tied hashes does make the access to Regexp::Common patterns slower than it might otherwise be. In contexts where impatience overrules laziness, Regexp::Common provides an additional subroutine-based interface. For each (sub-)entry in the C<%RE> hash (C<$RE{key1}{key2}{etc}>), there is a corresponding exportable subroutine: C. The name of each subroutine is the underscore-separated concatenation of the I keys that locate the same pattern in C<%RE>. Flags are passed to the subroutine in its argument list. Thus: use Regexp::Common qw( RE_ws_crop RE_num_real RE_profanity ); $str =~ RE_ws_crop() and die "Surrounded by whitespace"; $str =~ RE_num_real(-base=>8, -sep=>" ") or next; $offensive = RE_profanity(-keep); $str =~ s/$offensive/$bad{$1}++; ""/ge; Note that, unlike the hash-based interface (which returns objects), these subroutines return ordinary C'd regular expressions. Hence they do not curry, nor do they provide the OO match and substitution inlining described in the previous section. It is also possible to export subroutines for all available patterns like so: use Regexp::Common 'RE_ALL'; Or you can export all subroutines with a common prefix of keys like so: use Regexp::Common 'RE_num_ALL'; which will export C and C (and if you have create more patterns who have first key I, those will be exported as well). In general, I will export all subroutines whose pattern names have first keys I ... I. =head2 Adding new regular expressions You can add your own regular expressions to the C<%RE> hash at run-time, using the exportable C subroutine. It expects a hash-like list of key/value pairs that specify the behaviour of the pattern. The various possible argument pairs are: =over 4 =item C [ @list ]> A required argument that specifies the name of the pattern, and any flags it may take, via a reference to a list of strings. For example: pattern name => [qw( line of -char )], # other args here ; This specifies an entry C<$RE{line}{of}>, which may take a C<-char> flag. Flags may also be specified with a default value, which is then used whenever the flag is specified without an explicit value (but not when the flag is omitted). For example: pattern name => [qw( line of -char=_ )], # default char is '_' # other args here ; =item C $sub_ref_or_string> A required argument that specifies either a string that is to be returned as the pattern: pattern name => [qw( line of underscores )], create => q/(?:^_+$)/ ; or a reference to a subroutine that will be called to create the pattern: pattern name => [qw( line of -char=_ )], create => sub { my ($self, $flags) = @_; my $char = quotemeta $flags->{-char}; return '(?:^$char+$)'; }, ; If the subroutine version is used, the subroutine will be called with three arguments: a reference to the pattern object itself, a reference to a hash containing the flags and their values, and a reference to an array containing the non-flag keys. Whatever the subroutine returns is stringified as the pattern. No matter how the pattern is created, it is immediately postprocessed to include or exclude capturing parentheses (according to the value of the C<-keep> flag). To specify such "optional" capturing parentheses within the regular expression associated with C, use the notation C<(?k:...)>. Any parentheses of this type will be converted to C<(...)> when the C<-keep> flag is specified, or C<(?:...)> when it is not. It is a Regexp::Common convention that the outermost capturing parentheses always capture the entire pattern, but this is not enforced. =item C $sub_ref> An optional argument that specifies a subroutine that is to be called when the C<$RE{...}-Ematches(...)> method of this pattern is invoked. The subroutine should expect two arguments: a reference to the pattern object itself, and the string to be matched against. It should return the same types of values as a C does. pattern name => [qw( line of -char )], create => sub {...}, match => sub { my ($self, $str) = @_; $str !~ /[^$self->{flags}{-char}]/; }, ; =item C $sub_ref> An optional argument that specifies a subroutine that is to be called when the C<$RE{...}-Esubs(...)> method of this pattern is invoked. The subroutine should expect three arguments: a reference to the pattern object itself, the string to be changed, and the value to be substituted into it. The third argument may be C, indicating the default substitution is required. The subroutine should return the same types of values as an C does. For example: pattern name => [ 'lineof', '-char=_' ], create => sub {...}, subs => sub { my ($self, $str, $ignore_replacement) = @_; $_[1] =~ s/^$self->{flags}{-char}+$//g; }, ; Note that such a subroutine will almost always need to modify C<$_[1]> directly. =item C $minimum_perl_version> If this argument is given, it specifies the minimum version of perl required to use the new pattern. Attempts to use the pattern with earlier versions of perl will generate a fatal diagnostic. =back =head2 Loading specific sets of patterns. By default, all the sets of patterns listed below are made available. However, it is possible to indicate which sets of patterns should be made available - the wanted sets should be given as arguments to C. Alternatively, it is also possible to indicate which sets of patterns should not be made available - those sets will be given as argument to the C statement, but are preceded with an exclaimation mark. The argument I indicates none of the default patterns should be made available. This is useful for instance if all you want is the C subroutine. Examples: use Regexp::Common qw /comment number/; # Comment and number patterns. use Regexp::Common qw /no_defaults/; # Don't load any patterns. use Regexp::Common qw /!delimited/; # All, but delimited patterns. It's also possible to load your own set of patterns. If you have a module C that makes patterns available, you can have it made available with use Regexp::Common qw /my_patterns/; Note that the default patterns will still be made available - only if you use I, or mention one of the default sets explicitly, the non mentioned defaults aren't made available. =head2 List of available patterns The patterns listed below are currently available. Each set of patterns has its own manual page describing the details. For each pattern set named I, the manual page I describes the details. Currently available are: =over 4 =item Regexp::Common::balanced Provides regexes for strings with balanced parenthesized delimiters. =item Regexp::Common::comment Provides regexes for comments of various languages (43 languages currently). =item Regexp::Common::delimited Provides regexes for delimited strings. =item Regexp::Common::lingua Provides regexes for palindromes. =item Regexp::Common::list Provides regexes for lists. =item Regexp::Common::net Provides regexes for IPv4, IPv6, and MAC addresses. =item Regexp::Common::number Provides regexes for numbers (integers and reals). =item Regexp::Common::profanity Provides regexes for profanity. =item Regexp::Common::whitespace Provides regexes for leading and trailing whitespace. =item Regexp::Common::zip Provides regexes for zip codes. =back =head2 Forthcoming patterns and features Future releases of the module will also provide patterns for the following: * email addresses * HTML/XML tags * more numerical matchers, * mail headers (including multiline ones), * more URLS * telephone numbers of various countries * currency (universal 3 letter format, Latin-1, currency names) * dates * binary formats (e.g. UUencoded, MIMEd) If you have other patterns or pattern generators that you think would be generally useful, please send them to the maintainer -- preferably as source code using the C subroutine. Submissions that include a set of tests will be especially welcome. =head1 DIAGNOSTICS =over 4 =item C The subroutine-based interface didn't recognize the requested subroutine. Often caused by a spelling mistake or an incompletely specified name. =item C Regexp::Common doesn't have a generator for the requested pattern. Often indicates a misspelt or missing parameter. =item C The requested pattern requires advanced regex features (e.g. recursion) that not available in your version of Perl. Time to upgrade. =item C<< pattern() requires argument: name => [ @list ] >> Every user-defined pattern specification must have a name. =item C<< pattern() requires argument: create => $sub_ref_or_string >> Every user-defined pattern specification must provide a pattern creation mechanism: either a pattern string or a reference to a subroutine that returns the pattern string. =item C The C<< $RE{num}{real}{-base=>'I'} >> pattern uses the characters [0-9A-Z] to represent the digits of various bases. Hence it only produces regular expressions for bases up to hexatricensimal. =item C The pattern has no default delimiter. You need to write: C<< $RE{delimited}{-delim=>I'} >> for some character I =back =head1 ACKNOWLEDGEMENTS Deepest thanks to the many people who have encouraged and contributed to this project, especially: Elijah, Jarkko, Tom, Nat, Ed, and Vivek. Further thanks go to: Alexandr Ciornii, Blair Zajac, Bob Stockdale, Charles Thomas, Chris Vertonghen, the CPAN Testers, David Hand, Fany, Geoffrey Leach, Hermann-Marcus Behrens, Jerome Quelin, Jim Cromie, Lars Wilke, Linda Julien, Mike Arms, Mike Castle, Mikko, Murat Uenalan, RafaE<235>l Garcia-Suarez, Ron Savage, Sam Vilain, Slaven Rezic, Smylers, Tim Maher, and all the others I've forgotten. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. There are some POD issues when installing this module using a pre-5.6.0 perl; some manual pages may not install, or may not install correctly using a perl that is that old. You might consider upgrading your perl. =head1 NOT A BUG =over 4 =item * The various patterns are not anchored. That is, a pattern like C<< $RE {num} {int} >> will match against "abc4def", because a substring of the subject matches. This is by design, and not a bug. If you want the pattern to be anchored, use something like: my $integer = $RE {num} {int}; $subj =~ /^$integer$/ and print "Matches!\n"; =back =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. PK]b Common/SEN.pmnu6$package Regexp::Common::SEN; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; =begin does_not_exist sub par11 { my $string = shift; my $sum = 0; for my $i (0 .. length ($string) - 1) { my $c = substr ($string, $i, 1); $sum += $c * (length ($string) - $i) } !($sum % 11) } =end does_not_exist =cut # http://www.ssa.gov/history/ssn/geocard.html pattern name => [qw /SEN USA SSN -sep=-/], create => sub { my $sep = $_ [1] {-sep}; "(?k:(?k:[1-9][0-9][0-9]|0[1-9][0-9]|00[1-9])$sep" . "(?k:[1-9][0-9]|0[1-9])$sep" . "(?k:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|" . "00[1-9][0-9]|000[1-9]))" }, ; =begin does_not_exist It's not clear whether this is the right checksum. # http://www.google.nl/search?q=cache:8m1zKNYrEO0J:www.enschede.nl/nieuw/projecten/aanbesteding/integratie/pve%2520Bijlage%25207.5.doc+Sofi+nummer+formaat&hl=en&start=56&lr=lang_en|lang_nl&ie=UTF-8 pattern name => [qw /SEN Netherlands SoFi/], create => sub { # 9 digits (d1 d2 d3 d4 d5 d6 d7 d8 d9) # 9*d1 + 8*d2 + 7*d3 + 6*d4 + 5*d5 + 4*d6 + 3*d7 + 2*d8 + 1*d9 # == 0 mod 11. qr /([0-9]{9})(?(?{par11 ($^N)})|(?!))/; } ; =end does_not_exist =cut 1; __END__ =pod =head1 NAME Regexp::Common::SEN -- provide regexes for Social-Economical Numbers. =head1 SYNOPSIS use Regexp::Common qw /SEN/; while (<>) { /^$RE{SEN}{USA}{SSN}$/ and print "Social Security Number\n"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. =head2 C<$RE{SEN}{USA}{SSN}{-sep}> Returns a pattern that matches an American Social Security Number (SSN). SSNs consist of three groups of numbers, separated by a hyphen (C<->). This pattern only checks for a valid structure, that is, it validates whether a number is valid SSN, was a valid SSN, or maybe a valid SSN in the future. There are almost a billion possible SSNs, and about 400 million are in use, or have been in use. If C<-sep=I

> is specified, the pattern I

is used as the separator between the groups of numbers. Under C<-keep> (see L): =over 4 =item $1 captures the entire SSN. =item $2 captures the first group of digits (the area number). =item $3 captures the second group of digits (the group number). =item $4 captures the third group of digits (the serial number). =back =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHORS Damian Conway and Abigail. =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]a)::Common/number.pmnu6$package Regexp::Common::number; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Config; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; sub _croak { require Carp; goto &Carp::croak; } my $digits = join ("", 0 .. 9, "A" .. "Z"); sub int_creator { my $flags = $_ [1]; my ($sep, $group, $base, $places, $sign) = @{$flags} {qw /-sep -group -base -places -sign/}; # Deal with the bases. _croak "Base must be between 1 and 36" unless $base >= 1 && $base <= 36; my $chars = substr $digits, 0, $base; $sep = ',' if exists $flags -> {-sep} && !defined $flags -> {-sep}; my $max = $group; $max = $2 if $group =~ /^\s*(\d+)\s*,\s*(\d+)\s*$/; my $quant = $places ? "{$places}" : "+"; return $sep ? qq {(?k:(?k:$sign)(?k:[$chars]{1,$max}} . qq {(?:$sep} . qq {[$chars]{$group})*))} : qq {(?k:(?k:$sign)(?k:[$chars]$quant))} } sub real_creator { my ($base, $places, $radix, $sep, $group, $expon, $sign) = @{$_[1]}{-base, -places, -radix, -sep, -group, -expon, -sign}; _croak "Base must be between 1 and 36" unless $base >= 1 && $base <= 36; $sep = ',' if exists $_[1]->{-sep} && !defined $_[1]->{-sep}; if ($base > 14 && $expon =~ /^[Ee]$/) {$expon = 'G'} foreach ($radix, $sep, $expon) {$_ = "[$_]" if 1 == length} my $chars = substr $digits, 0, $base; return $sep ? qq {(?k:(?i)(?k:$sign)(?k:(?=$radix?[$chars])} . qq {(?k:[$chars]{1,$group}(?:(?:$sep)[$chars]{$group})*)} . qq {(?:(?k:$radix)(?k:[$chars]{$places}))?)} . qq {(?:(?k:$expon)(?k:(?k:$sign)(?k:[$chars]+))|))} : qq {(?k:(?i)(?k:$sign)(?k:(?=$radix?[$chars])} . qq {(?k:[$chars]*)(?:(?k:$radix)(?k:[$chars]{$places}))?)} . qq {(?:(?k:$expon)(?k:(?k:$sign)(?k:[$chars]+))|))}; } sub decimal_creator { my ($base, $places, $radix, $sep, $group, $sign) = @{$_[1]}{-base, -places, -radix, -sep, -group, -sign}; _croak "Base must be between 1 and 36" unless $base >= 1 && $base <= 36; $sep = ',' if exists $_[1]->{-sep} && !defined $_[1]->{-sep}; foreach ($radix, $sep) {$_ = "[$_]" if 1 == length} my $chars = substr $digits, 0, $base; return $sep ? qq {(?k:(?i)(?k:$sign)(?k:(?=$radix?[$chars])} . qq {(?k:[$chars]{1,$group}(?:(?:$sep)[$chars]{$group})*)} . qq {(?:(?k:$radix)(?k:[$chars]{$places}))?))} : qq {(?k:(?i)(?k:$sign)(?k:(?=$radix?[$chars])} . qq {(?k:[$chars]*)(?:(?k:$radix)(?k:[$chars]{$places}))?))} } pattern name => [qw (num int -sep= -base=10 -group=3 -sign=[-+]?)], create => \&int_creator, ; pattern name => [qw (num real -base=10), '-places=0,', qw (-radix=[.] -sep= -group=3 -expon=E -sign=[-+]?)], create => \&real_creator, ; pattern name => [qw (num decimal -base=10), '-places=0,', qw (-radix=[.] -sep= -group=3 -sign=[-+]?)], create => \&decimal_creator, ; sub real_synonym { my ($name, $base) = @_; pattern name => ['num', $name, '-places=0,', '-radix=[.]', '-sep=', '-group=3', '-expon=E', '-sign=[-+]?'], create => sub {my %flags = (%{$_[1]}, -base => $base); real_creator (undef, \%flags); } ; } real_synonym (hex => 16); real_synonym (dec => 10); real_synonym (oct => 8); real_synonym (bin => 2); # 2147483647 == 2^31 - 1 # 9223372036854775807 == 2^63 - 1 pattern name => [qw (num square)], create => sub { use re 'eval'; my $sixty_four_bits = $Config {use64bitint}; # # CPAN testers claim it fails on 5.8.8 and darwin 9.0. # my $num = $sixty_four_bits ? '0*(?:(?:9(?:[0-1][0-9]{17}' . '|2(?:[0-1][0-9]{16}' . '|2(?:[0-2][0-9]{15}' . '|3(?:[0-2][0-9]{14}' . '|3(?:[0-6][0-9]{13}' . '|7(?:[0-1][0-9]{12}' . '|20(?:[0-2][0-9]{10}' . '|3(?:[0-5][0-9]{9}' . '|6(?:[0-7][0-9]{8}' . '|8(?:[0-4][0-9]{7}' . '|5(?:[0-3][0-9]{6}' . '|4(?:[0-6][0-9]{5}' . '|7(?:[0-6][0-9]{4}' . '|7(?:[0-4][0-9]{3}' . '|5(?:[0-7][0-9]{2}' . '|80(?:[0-6])))))))))))))))))|[1-8]?[0-9]{0,18})' : '0*(?:2(?:[0-0][0-9]{8}' . '|1(?:[0-3][0-9]{7}' . '|4(?:[0-6][0-9]{6}' . '|7(?:[0-3][0-9]{5}' . '|4(?:[0-7][0-9]{4}' . '|8(?:[0-2][0-9]{3}' . '|3(?:[0-5][0-9]{2}' . '|6(?:[0-3][0-9]{1}' . '|4[0-7])))))))))|1?[0-9]{1,9}'; qr {($num)(?(?{length $^N && sqrt ($^N) == int sqrt ($^N)})|(?!))} }, ; pattern name => [qw (num roman)], create => '(?xi)(?=[MDCLXVI]) (?k:M{0,4} (?:C[DM]|D?C{0,4})? (?:X[LC]|L?X{0,4})? (?:I[VX]|V?I{0,4})?)' ; 1; __END__ =pod =head1 NAME Regexp::Common::number -- provide regexes for numbers =head1 SYNOPSIS use Regexp::Common qw /number/; while (<>) { /^$RE{num}{int}$/ and print "Integer\n"; /^$RE{num}{real}$/ and print "Real\n"; /^$RE{num}{real}{-base => 16}$/ and print "Hexadecimal real\n"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. =head2 C<$RE{num}{int}{-base}{-sep}{-group}{-places}{-sign}> Returns a pattern that matches an integer. If C<< -base => I >> is specified, the integer is in base I, with C<< 2 <= I <= 36 >>. For bases larger than 10, upper case letters are used. The default base is 10. If C<< -sep => I

>> is specified, the pattern I

is required as a grouping marker within the number. If this option is not given, no grouping marker is used. If C<< -group => I >> is specified, digits between grouping markers must be grouped in sequences of exactly I digits. The default value of I is 3. If C<< -group => I >> is specified, digits between grouping markers must be grouped in sequences of at least I digits, and at most I digits. This option is ignored unless the C<< -sep >> option is used. If C<< -places => I >> is specified, the integer recognized must be exactly I digits wide. If C<< -places => I >> is specified, the integer must be at least I wide, and at most I characters. There is no default, which means that integers are unlimited in size. This option is ignored if the C<< -sep >> option is used. If C<< -sign => I

>> is used, it's a pattern the leading sign has to match. This defaults to C<< [-+]? >>, which means the number is optionally preceded by a minus or a plus. If you want to match unsigned integers, use C<< $RE{num}{int}{-sign => ''} >>. For example: $RE{num}{int} # match 1234567 $RE{num}{int}{-sep=>','} # match 1,234,567 $RE{num}{int}{-sep=>',?'} # match 1234567 or 1,234,567 $RE{num}{int}{-sep=>'.'}{-group=>4} # match 1.2345.6789 Under C<-keep> (see L): =over 4 =item $1 captures the entire number =item $2 captures the optional sign of the number =item $3 captures the complete set of digits =back =head2 C<$RE{num}{real}{-base}{-radix}{-places}{-sep}{-group}{-expon}> Returns a pattern that matches a floating-point number. If C<-base=I> is specified, the number is assumed to be in that base (with A..Z representing the digits for 11..36). By default, the base is 10. If C<-radix=I

> is specified, the pattern I

is used as the radix point for the number (i.e. the "decimal point" in base 10). The default is C. If C<-places=I> is specified, the number is assumed to have exactly I places after the radix point. If C<-places=I> is specified, the number is assumed to have between I and I places after the radix point. By default, the number of places is unrestricted. If C<-sep=I

> specified, the pattern I

is required as a grouping marker within the pre-radix section of the number. By default, no separator is allowed. If C<-group=I> is specified, digits between grouping separators must be grouped in sequences of exactly I characters. The default value of I is 3. If C<-expon=I

> is specified, the pattern I

is used as the exponential marker. The default value of I

is C. If C<-sign=I

> is specified, the pattern I

is used to match the leading sign (and the sign of the exponent). This defaults to C<< [-+]? >>, means means that an optional plus or minus sign can be used. For example: $RE{num}{real} # matches 123.456 or -0.1234567 $RE{num}{real}{-places=>2} # matches 123.45 or -0.12 $RE{num}{real}{-places=>'0,3'} # matches 123.456 or 0 or 9.8 $RE{num}{real}{-sep=>'[,.]?'} # matches 123,456 or 123.456 $RE{num}{real}{-base=>3'} # matches 121.102 Under C<-keep>: =over 4 =item $1 captures the entire match =item $2 captures the optional sign of the number =item $3 captures the complete mantissa =item $4 captures the whole number portion of the mantissa =item $5 captures the radix point =item $6 captures the fractional portion of the mantissa =item $7 captures the optional exponent marker =item $8 captures the entire exponent value =item $9 captures the optional sign of the exponent =item $10 captures the digits of the exponent =back =head2 C<$RE{num}{dec}{-radix}{-places}{-sep}{-group}{-expon}> A synonym for C<< $RE{num}{real}{-base=>10}{...} >> =head2 C<$RE{num}{oct}{-radix}{-places}{-sep}{-group}{-expon}> A synonym for C<< $RE{num}{real}{-base=>8}{...} >> =head2 C<$RE{num}{bin}{-radix}{-places}{-sep}{-group}{-expon}> A synonym for C<< $RE{num}{real}{-base=>2}{...} >> =head2 C<$RE{num}{hex}{-radix}{-places}{-sep}{-group}{-expon}> A synonym for C<< $RE{num}{real}{-base=>16}{...} >> =head2 C<$RE{num}{decimal}{-base}{-radix}{-places}{-sep}{-group}> The same as C<$RE{num}{real}>, except that an exponent isn't allowed. Hence, this returns a pattern matching I numbers. If C<-base=I> is specified, the number is assumed to be in that base (with A..Z representing the digits for 11..36). By default, the base is 10. If C<-radix=I

> is specified, the pattern I

is used as the radix point for the number (i.e. the "decimal point" in base 10). The default is C. If C<-places=I> is specified, the number is assumed to have exactly I places after the radix point. If C<-places=I> is specified, the number is assumed to have between I and I places after the radix point. By default, the number of places is unrestricted. If C<-sep=I

> specified, the pattern I

is required as a grouping marker within the pre-radix section of the number. By default, no separator is allowed. If C<-group=I> is specified, digits between grouping separators must be grouped in sequences of exactly I characters. The default value of I is 3. For example: $RE{num}{decimal} # matches 123.456 or -0.1234567 $RE{num}{decimal}{-places=>2} # matches 123.45 or -0.12 $RE{num}{decimal}{-places=>'0,3'} # matches 123.456 or 0 or 9.8 $RE{num}{decimal}{-sep=>'[,.]?'} # matches 123,456 or 123.456 $RE{num}{decimal}{-base=>3'} # matches 121.102 Under C<-keep>: =over 4 =item $1 captures the entire match =item $2 captures the optional sign of the number =item $3 captures the complete mantissa =item $4 captures the whole number portion of the mantissa =item $5 captures the radix point =item $6 captures the fractional portion of the mantissa =back =head2 C<$RE{num}{square}> Returns a pattern that matches a (decimal) square. Because Perl's arithmetic is lossy when using integers over about 53 bits, this pattern only recognizes numbers less than 9000000000000000, if one uses a Perl that is configured to use 64 bit integers. Otherwise, the limit is 2147483647. These restrictions were introduced in versions 2.116 and 2.117 of Regexp::Common. Regardless whether C<-keep> was set, the matched number will be returned in C<$1>. =head2 C<$RE{num}{roman}> Returns a pattern that matches an integer written in Roman numbers. Case doesn't matter. There is no unique way of writing Roman numerals, but we will not match anything. We require the Roman numerals to list the symbols in order (largest first). The symbols for thousand (C<< M >>), hundred (C<< C >>), ten (C<< X >>), and one (C<< I >>) can not be repeated more than four times. The symbols for five hundred (C<< D >>), fifty (C<< L >>), and five (C<< V >>) may not appear more than once. A sequence of four repeated characters may also be written as a subtraction: by using the repeated character just once, and have it followed by the symbol which is 5 or 10 as large. So, four can be written as C<< IIII >>, or as C<< IV >>, and nine may be written as C<< VIIII >> or C<< IX >>. This corresponds to most modern uses of Roman numerals. The largest number which will be matched is 4999, or C<< MMMMDCCCCLXXXXVIIII >>, or C<< MMMMCMXCIX >>. Under C<-keep>, the number will be captured in $1. =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]?n Common/lingua.pmnu6$package Regexp::Common::lingua; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; pattern name => [qw /lingua palindrome -chars=[A-Za-z]/], create => sub { use re 'eval'; my $keep = exists $_ [1] -> {-keep}; my $ch = $_ [1] -> {-chars}; my $idx = $keep ? "1:$ch" : "0:$ch"; my $r = "(??{\$Regexp::Common::lingua::pd{'" . $idx . "'}})"; $Regexp::Common::lingua::pd {$idx} = $keep ? qr /($ch|($ch)($r)?\2)/ : qr /$ch|($ch)($r)?\1/; # print "[$ch]: ", $Regexp::Common::lingua::pd {$idx}, "\n"; # $Regexp::Common::lingua::pd {$idx}; }, ; 1; __END__ =pod =head1 NAME Regexp::Common::lingua -- provide regexes for language related stuff. =head1 SYNOPSIS use Regexp::Common qw /lingua/; while (<>) { /^$RE{lingua}{palindrome}$/ and print "is a palindrome\n"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. =head2 C<$RE{lingua}{palindrome}> Returns a pattern that recognizes a palindrome, a string that is the same if you reverse it. By default, it only matches strings consisting of letters, but this can be changed using the C<{-chars}> option. This option takes a character class (default is C<[A-Za-z]>) as argument. If C<{-keep}> is used, only C<$1> will be set, and set to the entire match. This pattern requires at least perl 5.6.0. =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Many regexes are missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]az00Common/delimited.pmnu6$package Regexp::Common::delimited; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; use charnames ':full'; our $VERSION = '2024080801'; sub gen_delimited { my ($dels, $escs, $cdels) = @_; # return '(?:\S*)' unless $dels =~ /\S/; if (defined $escs && length $escs) { $escs .= substr ($escs, -1) x (length ($dels) - length ($escs)); } if (defined $cdels && length $cdels) { $cdels .= substr ($cdels, -1) x (length ($dels) - length ($cdels)); } else { $cdels = $dels; } my @pat = (); for (my $i = 0; $i < length $dels; $i ++) { my $del = quotemeta substr ($dels, $i, 1); my $cdel = quotemeta substr ($cdels, $i, 1); my $esc = defined $escs && length ($escs) ? quotemeta substr ($escs, $i, 1) : ""; if ($cdel eq $esc) { push @pat => "(?k:$del)(?k:[^$cdel]*(?:(?:$cdel$cdel)[^$cdel]*)*)(?k:$cdel)"; } elsif (length $esc) { push @pat => "(?k:$del)(?k:[^$esc$cdel]*(?:$esc.[^$esc$cdel]*)*)(?k:$cdel)"; } else { push @pat => "(?k:$del)(?k:[^$cdel]*)(?k:$cdel)"; } } my $pat = join '|', @pat; return "(?k:(?|$pat))"; } sub _croak { require Carp; goto &Carp::croak; } pattern name => [qw( delimited -delim= -esc=\\ -cdelim= )], create => sub {my $flags = $_[1]; _croak 'Must specify delimiter in $RE{delimited}' unless length $flags->{-delim}; return gen_delimited (@{$flags}{-delim, -esc, -cdelim}); }, ; pattern name => [qw( quoted -esc=\\ )], create => sub {my $flags = $_[1]; return gen_delimited (q{"'`}, $flags -> {-esc}); }, ; my @bracket_pairs; if ($] >= 5.014) { # # List from http://xahlee.info/comp/unicode_matching_brackets.html # @bracket_pairs = map {ref $_ ? $_ : /!/ ? [(do {my $x = $_; $x =~ s/!/TOP/; $x}, do {my $x = $_; $x =~ s/!/BOTTOM/; $x})] : [(do {my $x = $_; $x =~ s/\?/LEFT/; $x}, do {my $x = $_; $x =~ s/\?/RIGHT/; $x})]} "? PARENTHESIS", "? SQUARE BRACKET", "? CURLY BRACKET", "? DOUBLE QUOTATION MARK", "? SINGLE QUOTATION MARK", "SINGLE ?-POINTING ANGLE QUOTATION MARK", "?-POINTING DOUBLE ANGLE QUOTATION MARK", "FULLWIDTH ? PARENTHESIS", "FULLWIDTH ? SQUARE BRACKET", "FULLWIDTH ? CURLY BRACKET", "FULLWIDTH ? WHITE PARENTHESIS", "? WHITE PARENTHESIS", "? WHITE SQUARE BRACKET", "? WHITE CURLY BRACKET", "? CORNER BRACKET", "? ANGLE BRACKET", "? DOUBLE ANGLE BRACKET", "? BLACK LENTICULAR BRACKET", "? TORTOISE SHELL BRACKET", "? BLACK TORTOISE SHELL BRACKET", "? WHITE CORNER BRACKET", "? WHITE LENTICULAR BRACKET", "? WHITE TORTOISE SHELL BRACKET", "HALFWIDTH ? CORNER BRACKET", "MATHEMATICAL ? WHITE SQUARE BRACKET", "MATHEMATICAL ? ANGLE BRACKET", "MATHEMATICAL ? DOUBLE ANGLE BRACKET", "MATHEMATICAL ? FLATTENED PARENTHESIS", "MATHEMATICAL ? WHITE TORTOISE SHELL BRACKET", "? CEILING", "? FLOOR", "Z NOTATION ? IMAGE BRACKET", "Z NOTATION ? BINDING BRACKET", [ "HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT", "HEAVY SINGLE " . "COMMA QUOTATION MARK ORNAMENT", ], [ "HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT", "HEAVY DOUBLE " . "COMMA QUOTATION MARK ORNAMENT", ], "MEDIUM ? PARENTHESIS ORNAMENT", "MEDIUM FLATTENED ? PARENTHESIS ORNAMENT", "MEDIUM ? CURLY BRACKET ORNAMENT", "MEDIUM ?-POINTING ANGLE BRACKET ORNAMENT", "HEAVY ?-POINTING ANGLE QUOTATION MARK ORNAMENT", "HEAVY ?-POINTING ANGLE BRACKET ORNAMENT", "LIGHT ? TORTOISE SHELL BRACKET ORNAMENT", "ORNATE ? PARENTHESIS", "! PARENTHESIS", "! SQUARE BRACKET", "! CURLY BRACKET", "! TORTOISE SHELL BRACKET", "PRESENTATION FORM FOR VERTICAL ? CORNER BRACKET", "PRESENTATION FORM FOR VERTICAL ? WHITE CORNER BRACKET", "PRESENTATION FORM FOR VERTICAL ? TORTOISE SHELL BRACKET", "PRESENTATION FORM FOR VERTICAL ? BLACK LENTICULAR BRACKET", "PRESENTATION FORM FOR VERTICAL ? WHITE LENTICULAR BRACKET", "PRESENTATION FORM FOR VERTICAL ? ANGLE BRACKET", "PRESENTATION FORM FOR VERTICAL ? DOUBLE ANGLE BRACKET", "PRESENTATION FORM FOR VERTICAL ? SQUARE BRACKET", "PRESENTATION FORM FOR VERTICAL ? CURLY BRACKET", "?-POINTING ANGLE BRACKET", "? ANGLE BRACKET WITH DOT", "?-POINTING CURVED ANGLE BRACKET", "SMALL ? PARENTHESIS", "SMALL ? CURLY BRACKET", "SMALL ? TORTOISE SHELL BRACKET", "SUPERSCRIPT ? PARENTHESIS", "SUBSCRIPT ? PARENTHESIS", "? SQUARE BRACKET WITH UNDERBAR", [ "LEFT SQUARE BRACKET WITH TICK IN TOP CORNER", "RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER", ], [ "LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER", "RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER", ], "? SQUARE BRACKET WITH QUILL", "TOP ? HALF BRACKET", "BOTTOM ? HALF BRACKET", "? S-SHAPED BAG DELIMITER", [ "LEFT ARC LESS-THAN BRACKET", "RIGHT ARC GREATER-THAN BRACKET", ], [ "DOUBLE LEFT ARC GREATER-THAN BRACKET", "DOUBLE RIGHT ARC LESS-THAN BRACKET", ], "? SIDEWAYS U BRACKET", "? DOUBLE PARENTHESIS", "? WIGGLY FENCE", "? DOUBLE WIGGLY FENCE", "? LOW PARAPHRASE BRACKET", "? RAISED OMISSION BRACKET", "? SUBSTITUTION BRACKET", "? DOTTED SUBSTITUTION BRACKET", "? TRANSPOSITION BRACKET", [ "OGHAM FEATHER MARK", "OGHAM REVERSED FEATHER MARK", ], [ "TIBETAN MARK GUG RTAGS GYON", "TIBETAN MARK GUG RTAGS GYAS", ], [ "TIBETAN MARK ANG KHANG GYON", "TIBETAN MARK ANG KHANG GYAS", ], ; # # Filter out unknown characters; this may run on an older version # of Perl with an old version of Unicode. # @bracket_pairs = grep {defined charnames::string_vianame ($$_ [0]) && defined charnames::string_vianame ($$_ [1])} @bracket_pairs; if (@bracket_pairs) { my $delims = join "" => map {charnames::string_vianame ($$_ [0])} @bracket_pairs; my $cdelims = join "" => map {charnames::string_vianame ($$_ [1])} @bracket_pairs; pattern name => [qw (bquoted -esc=\\)], create => sub {my $flags = $_ [1]; return gen_delimited ($delims, $flags -> {-esc}, $cdelims); }, version => 5.014, ; } } # # Return the Unicode names of the pairs of matching delimiters. # sub bracket_pairs {@bracket_pairs} 1; __END__ =pod =head1 NAME Regexp::Common::delimited -- provides a regex for delimited strings =head1 SYNOPSIS use Regexp::Common qw /delimited/; while (<>) { /$RE{delimited}{-delim=>'"'}/ and print 'a \" delimited string'; /$RE{delimited}{-delim=>'/'}/ and print 'a \/ delimited string'; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. =head2 C<$RE{delimited}{-delim}{-cdelim}{-esc}> Returns a pattern that matches a single-character-delimited substring, with optional internal escaping of the delimiter. When C<-delim => I> is specified, each character in the sequence I is a possible delimiter. There is no default delimiter, so this flag must always be specified. By default, the closing delimiter is the same character as the opening delimiter. If this is not wanted, for instance, if you want to match a string with symmetric delimiters, you can specify the closing delimiter(s) with C<-cdelim => I>. Each character in I is matched with the corresponding character supplied with the C<-delim> option. If the C<-cdelim> option has less characters than the C<-delim> option, the last character is repeated as often as necessary. If the C<-cdelim> option has more characters than the C<-delim> option, the extra characters are ignored. If C<-esc => I> is specified, each character in the sequence I is the delimiter for the corresponding character in the C<-delim=I> list. The default escape is backslash. For example: $RE{delimited}{-delim=>'"'} # match "a \" delimited string" $RE{delimited}{-delim=>'"'}{-esc=>'"'} # match "a "" delimited string" $RE{delimited}{-delim=>'/'} # match /a \/ delimited string/ $RE{delimited}{-delim=>q{'"}} # match "string" or 'string' $RE{delimited}{-delim=>"("}{-cdelim=>")"} # match (string) Under C<-keep> (See L): =over 4 =item $1 captures the entire match =item $2 captures the opening delimiter =item $3 captures delimited portion of the string =item $4 captures the closing delimiter =back =head2 $RE{quoted}{-esc} A synonym for C<< $RE {delimited} {-delim => q {'"`}} {...} >>. =head2 $RE {bquoted} {-esc} This is a pattern which matches delimited strings, where the delimiters are a set of matching brackets. Currently, this comes 85 pairs. This includes the 60 pairs of bidirection paired brackets, as listed in L<< http://www.unicode.org/Public/UNIDATA/BidiBrackets.txt >>. The other 25 pairs are the quotation marks, the double quotation marks, the single and double pointing quoation marks, the heavy single and double commas, 4 pairs of top-bottom parenthesis and brackets, 9 pairs of presentation form for vertical brackets, and the low paraphrase, raised omission, substitution, double substitution, and transposition brackets. In a future update, pairs may be added (or deleted). This pattern requires perl 5.14.0 or higher. For a full list of bracket pairs, inspect the output of C<< Regexp::Common::delimited::bracket_pair () >>, which returns a list of two element arrays, each holding the Unicode names of matching pair of delimiters. The C<< {-esc => I } >> works as in the C<< $RE {delimited} >> pattern. If C<< {-keep} >> is given, the following things will be captured: =over 4 =item $1 captures the entire match =item $2 captures the opening delimiter =item $3 captures delimited portion of the string =item $4 captures the closing delimiter =back =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]3 Common/profanity.pmnu6$package Regexp::Common::profanity; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; my $profanity = '(?:cvff(?:\\ gnxr|\\-gnxr|gnxr|r(?:ef|[feq])|vat|l)?|dhvzf?|fuvg(?:g(?:r(?:ef|[qe])|vat|l)|r(?:ef|[fqel])|vat|[fr])?|g(?:heqf?|jngf?)|jnax(?:r(?:ef|[eq])|vat|f)?|n(?:ef(?:r(?:\\ ubyr|\\-ubyr|ubyr|[fq])|vat|r)|ff(?:\\ ubyrf?|\\-ubyrf?|rq|ubyrf?|vat))|o(?:hyy(?:\\ fuvg(?:g(?:r(?:ef|[qe])|vat)|f)?|\\-fuvg(?:g(?:r(?:ef|[qe])|vat)|f)?|fuvg(?:g(?:r(?:ef|[qe])|vat)|f)?)|ybj(?:\\ wbof?|\\-wbof?|wbof?))|p(?:bpx(?:\\ fhpx(?:ref?|vat)|\\-fhpx(?:ref?|vat)|fhpx(?:ref?|vat))|enc(?:c(?:r(?:ef|[eq])|vat|l)|f)?|h(?:agf?|z(?:vat|zvat|f)))|qvpx(?:\\ urnq|\\-urnq|rq|urnq|vat|yrff|f)|s(?:hpx(?:rq|vat|f)?|neg(?:r[eq]|vat|[fl])?|rygpu(?:r(?:ef|[efq])|vat)?)|un(?:eq[\\-\\ ]?ba|ys(?:\\ n[fe]|\\-n[fe]|n[fe])frq)|z(?:bgure(?:\\ shpx(?:ref?|vat)|\\-shpx(?:ref?|vat)|shpx(?:ref?|vat))|hgu(?:n(?:\\ shpx(?:ref?|vat|[nnn])|\\-shpx(?:ref?|vat|[nnn])|shpx(?:ref?|vat|[nnn]))|re(?:\\ shpx(?:ref?|vat)|\\-shpx(?:ref?|vat)|shpx(?:ref?|vat)))|reqr?))'; my $contextual = '(?:c(?:bex|e(?:bax|vpxf?)|hff(?:vrf|l)|vff(?:\\ gnxr|\\-gnxr|gnxr|r(?:ef|[feq])|vat|l)?)|dhvzf?|ebbg(?:r(?:ef|[eq])|vat|f)?|f(?:bq(?:q(?:rq|vat)|f)?|chax|perj(?:rq|vat|f)?|u(?:nt(?:t(?:r(?:ef|[qe])|vat)|f)?|vg(?:g(?:r(?:ef|[qe])|vat|l)|r(?:ef|[fqel])|vat|[fr])?))|g(?:heqf?|jngf?|vgf?)|jnax(?:r(?:ef|[eq])|vat|f)?|n(?:ef(?:r(?:\\ ubyr|\\-ubyr|ubyr|[fq])|vat|r)|ff(?:\\ ubyrf?|\\-ubyrf?|rq|ubyrf?|vat))|o(?:ba(?:r(?:ef|[fe])|vat|r)|h(?:ttre|yy(?:\\ fuvg(?:g(?:r(?:ef|[qe])|vat)|f)?|\\-fuvg(?:g(?:r(?:ef|[qe])|vat)|f)?|fuvg(?:g(?:r(?:ef|[qe])|vat)|f)?))|n(?:fgneq|yy(?:r(?:ef|[qe])|vat|f)?)|yb(?:bql|j(?:\\ wbof?|\\-wbof?|wbof?)))|p(?:bpx(?:\\ fhpx(?:ref?|vat)|\\-fhpx(?:ref?|vat)|fhpx(?:ref?|vat)|f)?|enc(?:c(?:r(?:ef|[eq])|vat|l)|f)?|h(?:agf?|z(?:vat|zvat|f)))|q(?:batf?|vpx(?:\\ urnq|\\-urnq|rq|urnq|vat|yrff|f)?)|s(?:hpx(?:rq|vat|f)?|neg(?:r[eq]|vat|[fl])?|rygpu(?:r(?:ef|[efq])|vat)?)|u(?:hzc(?:r(?:ef|[eq])|vat|f)?|n(?:eq[\\-\\ ]?ba|ys(?:\\ n[fe]|\\-n[fe]|n[fe])frq))|z(?:bgure(?:\\ shpx(?:ref?|vat)|\\-shpx(?:ref?|vat)|shpx(?:ref?|vat))|hgu(?:n(?:\\ shpx(?:ref?|vat|[nnn])|\\-shpx(?:ref?|vat|[nnn])|shpx(?:ref?|vat|[nnn]))|re(?:\\ shpx(?:ref?|vat)|\\-shpx(?:ref?|vat)|shpx(?:ref?|vat)))|reqr?))'; tr/A-Za-z/N-ZA-Mn-za-m/ foreach $profanity, $contextual; pattern name => [qw (profanity)], create => '(?:\b(?k:' . $profanity . ')\b)', ; pattern name => [qw (profanity contextual)], create => '(?:\b(?k:' . $contextual . ')\b)', ; 1; __END__ =pod =head1 NAME Regexp::Common::profanity -- provide regexes for profanity =head1 SYNOPSIS use Regexp::Common qw /profanity/; while (<>) { /$RE{profanity}/ and print "Contains profanity\n"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. =head2 $RE{profanity} Returns a pattern matching words -- such as Carlin's "big seven" -- that are most likely to give offense. Note that correct anatomical terms are deliberately I included in the list. Under C<-keep> (see L): =over 4 =item $1 captures the entire word =back =head2 C<$RE{profanity}{contextual}> Returns a pattern matching words that are likely to give offense when used in specific contexts, but which also have genuinely non-offensive meanings. Under C<-keep> (see L): =over 4 =item $1 captures the entire word =back =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]ވ||Common/comment.pmnu6$package Regexp::Common::comment; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; my @generic = ( {languages => [qw /ABC Forth/], to_eol => ['\\\\']}, # This is for just a *single* backslash. {languages => [qw /Ada Alan Eiffel lua/], to_eol => ['--']}, {languages => [qw /Advisor/], to_eol => ['#|//']}, {languages => [qw /Advsys CQL Lisp LOGO M MUMPS REBOL Scheme SMITH zonefile/], to_eol => [';']}, {languages => ['Algol 60'], from_to => [[qw /comment ;/]]}, {languages => [qw {ALPACA B C C-- LPC PL/I}], from_to => [[qw {/* */}]]}, {languages => [qw /awk fvwm2 Icon m4 mutt Perl Python QML R Ruby shell Tcl/], to_eol => ['#']}, {languages => [[BASIC => 'mvEnterprise']], to_eol => ['[*!]|REM']}, {languages => [qw /Befunge-98 Funge-98 Shelta/], id => [';']}, {languages => ['beta-Juliet', 'Crystal Report', 'Portia', 'Ubercode'], to_eol => ['//']}, {languages => ['BML'], from_to => [['']], }, {languages => [qw /C++/, 'C#', qw /Cg ECMAScript FPL Java JavaScript/], to_eol => ['//'], from_to => [[qw {/* */}]]}, {languages => [qw /CLU LaTeX slrn TeX/], to_eol => ['%']}, {languages => [qw /False/], from_to => [[qw !{ }!]]}, {languages => [qw /Fortran/], to_eol => ['!']}, {languages => [qw /Haifu/], id => [',']}, {languages => [qw /ILLGOL/], to_eol => ['NB']}, {languages => [qw /INTERCAL/], to_eol => [q{(?:(?:PLEASE(?:\s+DO)?|DO)\s+)?(?:NOT|N'T)}]}, {languages => [qw /J/], to_eol => ['NB[.]']}, {languages => [qw /JavaDoc/], from_to => [[qw {/** */}]]}, {languages => [qw /Nickle/], to_eol => ['#'], from_to => [[qw {/* */}]]}, {languages => [qw /Oberon/], from_to => [[qw /(* *)/]]}, {languages => [[qw /Pascal Delphi/], [qw /Pascal Free/], [qw /Pascal GPC/]], to_eol => ['//'], from_to => [[qw !{ }!], [qw !(* *)!]]}, {languages => [[qw /Pascal Workshop/]], id => [qw /"/], from_to => [[qw !{ }!], [qw !(* *)!], [qw !/* */!]]}, {languages => [qw /PEARL/], to_eol => ['!'], from_to => [[qw {/* */}]]}, {languages => [qw /PHP/], to_eol => ['#', '//'], from_to => [[qw {/* */}]]}, {languages => [qw !PL/B!], to_eol => ['[.;]']}, {languages => [qw !PL/SQL!], to_eol => ['--'], from_to => [[qw {/* */}]]}, {languages => [qw /Q-BAL/], to_eol => ['`']}, {languages => [qw /Smalltalk/], id => ['"']}, {languages => [qw /SQL/], to_eol => ['-{2,}']}, {languages => [qw /troff/], to_eol => ['\\\"']}, {languages => [qw /vi/], to_eol => ['"']}, {languages => [qw /*W/], from_to => [[qw {|| !!}]]}, {languages => [qw /ZZT-OOP/], to_eol => ["'"]}, ); my @plain_or_nested = ( [Caml => undef, "(*" => "*)"], [Dylan => "//", "/*" => "*/"], [Haskell => "-{2,}", "{-" => "-}"], [Hugo => "!(?!\\\\)", "!\\" => "\\!"], [SLIDE => "#", "(*" => "*)"], ['Modula-2' => undef, "(*" => "*)"], ['Modula-3' => undef, "(*" => "*)"], ); # # Helper subs. # sub combine { local $_ = join "|", @_; if (@_ > 1) { s/\(\?k:/(?:/g; $_ = "(?k:$_)"; } $_ } sub to_eol ($) {"(?k:(?k:$_[0])(?k:[^\\n]*)(?k:\\n))"} sub id ($) {"(?k:(?k:$_[0])(?k:[^$_[0]]*)(?k:$_[0]))"} # One char only! sub from_to { my ($begin, $end) = @_; my $qb = quotemeta $begin; my $qe = quotemeta $end; my $fe = quotemeta substr $end => 0, 1; my $te = quotemeta substr $end => 1; "(?k:(?k:$qb)(?k:(?:[^$fe]+|$fe(?!$te))*)(?k:$qe))"; } my $count = 0; sub nested { my ($begin, $end) = @_; $count ++; my $r = '(??{$Regexp::Common::comment ['. $count . ']})'; my $qb = quotemeta $begin; my $qe = quotemeta $end; my $fb = quotemeta substr $begin => 0, 1; my $fe = quotemeta substr $end => 0, 1; my $tb = quotemeta substr $begin => 1; my $te = quotemeta substr $end => 1; use re 'eval'; my $re; if ($fb eq $fe) { $re = qr /(?:$qb(?:(?>[^$fb]+)|$fb(?!$tb)(?!$te)|$r)*$qe)/; } else { local $" = "|"; my @clauses = "(?>[^$fb$fe]+)"; push @clauses => "$fb(?!$tb)" if length $tb; push @clauses => "$fe(?!$te)" if length $te; push @clauses => $r; $re = qr /(?:$qb(?:@clauses)*$qe)/; } $Regexp::Common::comment [$count] = qr/$re/; } # # Process data. # foreach my $info (@plain_or_nested) { my ($language, $mark, $begin, $end) = @$info; pattern name => [comment => $language], create => sub {my $re = nested $begin => $end; my $prefix = defined $mark ? $mark . "[^\n]*\n|" : ""; exists $_ [1] -> {-keep} ? qr /($prefix$re)/ : qr /$prefix$re/ }, ; } foreach my $group (@generic) { my $pattern = combine +(map {to_eol $_} @{$group -> {to_eol}}), (map {from_to @$_} @{$group -> {from_to}}), (map {id $_} @{$group -> {id}}), ; foreach my $language (@{$group -> {languages}}) { pattern name => [comment => ref $language ? @$language : $language], create => $pattern, ; } } # # Other languages. # # http://www.pascal-central.com/docs/iso10206.txt pattern name => [qw /comment Pascal/], create => '(?k:' . '(?k:[{]|[(][*])' . '(?k:[^}*]*(?:[*](?![)])[^}*]*)*)' . '(?k:[}]|[*][)])' . ')' ; # http://www.templetons.com/brad/alice/language/ pattern name => [qw /comment Pascal Alice/], create => '(?k:(?k:[{])(?k:[^}\n]*)(?k:[}]))' ; # http://westein.arb-phys.uni-dortmund.de/~wb/a68s.txt pattern name => [qw (comment), 'Algol 68'], create => q {(?k:(?:#[^#]*#)|} . q {(?:\bco\b(?:[^c]+|\Bc|\bc(?!o\b))*\bco\b)|} . q {(?:\bcomment\b(?:[^c]+|\Bc|\bc(?!omment\b))*\bcomment\b))} ; # See rules 91 and 92 of ISO 8879 (SGML). # Charles F. Goldfarb: "The SGML Handbook". # Oxford: Oxford University Press. 1990. ISBN 0-19-853737-9. # Ch. 10.3, pp 390. pattern name => [qw (comment HTML)], create => q {(?k:(?k:))}, ; # MySQL comments: # -- Till end of line (whitespace must follow --) # # Till end of line # /* Multiline comment */ # https://dev.mysql.com/doc/refman/8.4/en/comments.html # # Note the use of (?u:\s) instead of \s. If Unicode isn't in effect, \s does # not quite match the same characters as [\v\h]. See the beginning of the # section "Whitespace" section in perlrecharclass manual. pattern name => [qw /comment SQL MySQL/], create => q {(?k:(?:#|--(?=(?u:\s)))[^\n]*\n|} . q {/\*(?:(?>[^*]+)|\*(?!/))*(?:;|\*/))}, ; # Anything that isn't <>[]+-., # http://home.wxs.nl/~faase009/Ha_BF.html pattern name => [qw /comment Brainfuck/], create => '(?k:[^<>\[\]+\-.,]+)' ; # Squeak is a variant of Smalltalk-80. # http://www.squeak. # http://mucow.com/squeak-qref.html pattern name => [qw /comment Squeak/], create => '(?k:(?k:")(?k:[^"]*(?:""[^"]*)*)(?k:"))' ; # # Scores of less than 5 or above 17.... # http://www.cliff.biffle.org/esoterica/beatnik.html @Regexp::Common::comment::scores = (1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10); { my ($s, $x); pattern name => [qw /comment Beatnik/], create => sub { use re 'eval'; my $re = qr {\b([A-Za-z]+)\b (?(?{($s, $x) = (0, lc $^N); $s += $Regexp::Common::comment::scores [ord (chop $x) - ord ('a')] while length $x; $s >= 5 && $s < 18})XXX|)}x; $re; }, ; } # http://www.cray.com/craydoc/manuals/007-3692-005/html-007-3692-005/ # (Goto table of contents/3.3 Source Form) # Fortran, in fixed format. Comments start with a C, c or * in the first # column, or a ! anywhere, but the sixth column. Then end with a newline. pattern name => [qw /comment Fortran fixed/], create => '(?k:(?k:(?:^[Cc*]|(? [qw /comment COBOL/], create => '(?<=^......)(?k:(?k:[*])(?k:[^\n]*)(?k:\n))', ; 1; __END__ =pod =head1 NAME Regexp::Common::comment -- provide regexes for comments. =head1 SYNOPSIS use Regexp::Common qw /comment/; while (<>) { /$RE{comment}{C}/ and print "Contains a C comment\n"; /$RE{comment}{C++}/ and print "Contains a C++ comment\n"; /$RE{comment}{PHP}/ and print "Contains a PHP comment\n"; /$RE{comment}{Java}/ and print "Contains a Java comment\n"; /$RE{comment}{Perl}/ and print "Contains a Perl comment\n"; /$RE{comment}{awk}/ and print "Contains an awk comment\n"; /$RE{comment}{HTML}/ and print "Contains an HTML comment\n"; } use Regexp::Common qw /comment RE_comment_HTML/; while (<>) { $_ =~ RE_comment_HTML() and print "Contains an HTML comment\n"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. This modules gives you regular expressions for comments in various languages. =head2 THE LANGUAGES Below, the comments of each of the languages are described. The patterns are available as C<$RE{comment}{I}>, foreach language I. Some languages have variants; it's described at the individual languages how to get the patterns for the variants. Unless mentioned otherwise, C<{-keep}> sets C<$1>, C<$2>, C<$3> and C<$4> to the entire comment, the opening marker, the content of the comment, and the closing marker (for many languages, the latter is a newline) respectively. =over 4 =item ABC Comments in I start with a backslash (C<\>), and last till the end of the line. See L. =item Ada Comments in I start with C<-->, and last till the end of the line. =item Advisor I is a language used by the HP product I. Comments for this language start with either C<#> or C, and last till the end of the line. =item Advsys Comments for the I language start with C<;> and last till the end of the line. See also L. =item Alan I comments start with C<-->, and last till the end of the line. See also L. =item Algol 60 Comments in the I language start with the keyword C, and end with a C<;>. See L. =item Algol 68 In I, comments are either delimited by C<#>, or by one of the keywords C or C. The keywords should not be part of another word. See L. With C<{-keep}>, only C<$1> will be set, returning the entire comment. =item ALPACA The I language has comments starting with C and ending with C<*/>. =item awk The I programming language uses comments that start with C<#> and end at the end of the line. =item B The I language has comments starting with C and ending with C<*/>. =item BASIC There are various forms of BASIC around. Currently, we only support the variant supported by I, whose pattern is available as C<$RE{comment}{BASIC}{mvEnterprise}>. Comments in this language start with a C, a C<*> or the keyword C, and end till the end of the line. See L. =item Beatnik The esotoric language I only uses words consisting of letters. Words are scored according to the rules of Scrabble. Words scoring less than 5 points, or 18 points or more are considered comments (although the compiler might mock at you if you score less than 5 points). Regardless whether C<{-keep}>, C<$1> will be set, and set to the entire comment. This pattern requires I or newer. =item beta-Juliet The I programming language has comments that start with C and that continue till the end of the line. See also L. =item Befunge-98 The esotoric language I uses comments that start and end with a C<;>. See L. =item BML I, or I is an HTML templating language that uses comments starting with C<< >, and ending with C<< c_?> >>. See L. =item Brainfuck The minimal language I uses only eight characters, C>, C>, C<[>, C<]>, C<+>, C<->, C<.> and C<,>. Any other characters are considered comments. With C<{-keep}>, C<$1> is set to the entire comment. =item C The I language has comments starting with C and ending with C<*/>. =item C-- The I language has comments starting with C and ending with C<*/>. See L. =item C++ The I language has two forms of comments. Comments that start with C and last till the end of the line, and comments that start with C, and end with C<*/>. If C<{-keep}> is used, only C<$1> will be set, and set to the entire comment. =item C# The I language has two forms of comments. Comments that start with C and last till the end of the line, and comments that start with C, and end with C<*/>. If C<{-keep}> is used, only C<$1> will be set, and set to the entire comment. See L. =item Caml Comments in I start with C<(*>, end with C<*)>, and can be nested. See L and L. =item Cg The I language has two forms of comments. Comments that start with C and last till the end of the line, and comments that start with C, and end with C<*/>. If C<{-keep}> is used, only C<$1> will be set, and set to the entire comment. See L. =item CLU In C, a comment starts with a procent sign (C<%>), and ends with the next newline. See L and L. =item COBOL Traditionally, comments in I are indicated by an asteriks in the seventh column. This is what the pattern matches. Modern compiler may more lenient though. See L, and L. =item CQL Comments in the chess query language (I) start with a semi colon (C<;>) and last till the end of the line. See L. =item Crystal Report The formula editor in I uses comments that start with C, and end with the end of the line. =item Dylan There are two types of comments in I. They either start with C, or are nested comments, delimited with C and C<*/>. Under C<{-keep}>, only C<$1> will be set, returning the entire comment. This pattern requires I or newer. =item ECMAScript The I language has two forms of comments. Comments that start with C and last till the end of the line, and comments that start with C, and end with C<*/>. If C<{-keep}> is used, only C<$1> will be set, and set to the entire comment. I is Netscapes implementation of I. See L, and L. =item Eiffel I comments start with C<-->, and last till the end of the line. =item False In I, comments start with C<{> and end with C<}>. See L =item FPL The I language has two forms of comments. Comments that start with C and last till the end of the line, and comments that start with C, and end with C<*/>. If C<{-keep}> is used, only C<$1> will be set, and set to the entire comment. =item Forth Comments in Forth start with C<\>, and end with the end of the line. See also L. =item Fortran There are two forms of I. There's free form I, which has comments that start with C, and end at the end of the line. The pattern for this is given by C<$RE{Fortran}>. Fixed form I, which has been obsoleted, has comments that start with C, C or C<*> in the first column, or with C anywhere, but the sixth column. The pattern for this are given by C<$RE{Fortran}{fixed}>. See also L. =item Funge-98 The esotoric language I uses comments that start and end with a C<;>. =item fvwm2 Configuration files for I have comments starting with a C<#> and lasting the rest of the line. =item Haifu I, an esotoric language using haikus, has comments starting and ending with a C<,>. See L. =item Haskell There are two types of comments in I. They either start with at least two dashes, or are nested comments, delimited with C<{-> and C<-}>. Under C<{-keep}>, only C<$1> will be set, returning the entire comment. This pattern requires I or newer. =item HTML In I, comments only appear inside a I. A comment declaration starts with a C!>, and ends with a C>. Inside this declaration, we have zero or more comments. Comments starts with C<--> and end with C<-->, and are optionally followed by whitespace. The pattern C<$RE{comment}{HTML}> recognizes those comment declarations (and hence more than a comment). Note that this is not the same as something that starts with C!--> and ends with C<--E>, because the following will be matched completely: Second Comment Do not be fooled by what your favourite browser thinks is an HTML comment. If C<{-keep}> is used, the following are returned: =over 4 =item $1 captures the entire comment declaration. =item $2 captures the MDO (markup declaration open), C!>. =item $3 captures the content between the MDO and the MDC. =item $4 captures the (last) comment, without the surrounding dashes. =item $5 captures the MDC (markup declaration close), C>. =back =item Hugo There are two types of comments in I. They either start with C (which cannot be followed by a C<\>), or are nested comments, delimited with C and C<\!>. Under C<{-keep}>, only C<$1> will be set, returning the entire comment. This pattern requires I or newer. =item Icon I has comments that start with C<#> and end at the next new line. See L, L, and L. =item ILLGOL The esotoric language I uses comments starting with I and lasting till the end of the line. See L. =item INTERCAL Comments in INTERCAL are single line comments. They start with one of the keywords C or C, and can optionally be preceded by the keywords C and C. If both keywords are used, C precedes C. Keywords are separated by whitespace. =item J The language I uses comments that start with C, and that last till the end of the line. See L, and L. =item Java The I language has two forms of comments. Comments that start with C and last till the end of the line, and comments that start with C, and end with C<*/>. If C<{-keep}> is used, only C<$1> will be set, and set to the entire comment. =item JavaDoc The I documentation syntax is demarked with a subset of ordinary Java comments to separate it from code. Comments start with C end with C<*/>. If C<{-keep}> is used, only C<$1> will be set, and set to the entire comment. See L. =item JavaScript The I language has two forms of comments. Comments that start with C and last till the end of the line, and comments that start with C, and end with C<*/>. If C<{-keep}> is used, only C<$1> will be set, and set to the entire comment. I is Netscapes implementation of I. See L, and L. =item LaTeX The documentation language I uses comments starting with C<%> and ending at the end of the line. =item Lisp Comments in I start with a semi-colon (C<;>) and last till the end of the line. =item LPC The I language has comments starting with C and ending with C<*/>. =item LOGO Comments for the language I start with C<;>, and last till the end of the line. =item lua Comments for the I language start with C<-->, and last till the end of the line. See also L. =item M, MUMPS In C (aka C), comments start with a semi-colon, and last till the end of a line. The language specification requires the semi-colon to be preceded by one or more Is. Those characters default to a space, but that's configurable. This requirement, of preceding the comment with linestart characters is B tested for. See L, L, and L. =item m4 By default, the preprocessor language I uses single line comments, that start with a C<#> and continue to the end of the line, including the newline. The pattern C<$RE {comment} {m4}> matches such comments. In I, it is possible to change the starting token though. See L, L, and L. =item Modula-2 In C, comments start with C<(*>, and end with C<*)>. Comments may be nested. See L. =item Modula-3 In C, comments start with C<(*>, and end with C<*)>. Comments may be nested. See L. =item mutt Configuration files for I have comments starting with a C<#> and lasting the rest of the line. =item Nickle The I language has one line comments starting with C<#> (like Perl), or multiline comments delimited by C and C<*/> (like C). Under C<-keep>, only C<$1> will be set. See also L. =item Oberon Comments in I start with C<(*> and end with C<*)>. See L. =item Pascal There are many implementations of Pascal. This modules provides pattern for comments of several implementations. =over 4 =item C<$RE{comment}{Pascal}> This is the pattern that recognizes comments according to the Pascal ISO standard. This standard says that comments start with either C<{>, or C<(*>, and end with C<}> or C<*)>. This means that C<{*)> and C<(*}> are considered to be comments. Many Pascal applications don't allow this. See L =item C<$RE{comment}{Pascal}{Alice}> The I compiler accepts comments that start with C<{> and end with C<}>. Comments are not allowed to contain newlines. See L. =item C<$RE{comment}{Pascal}{Delphi}>, C<$RE{comment}{Pascal}{Free}> and C<$RE{comment}{Pascal}{GPC}> The I, I and the I implementations of Pascal all have comments that either start with C and last till the end of the line, are delimited with C<{> and C<}> or are delimited with C<(*> and C<*)>. Patterns for those comments are given by C<$RE{comment}{Pascal}{Delphi}>, C<$RE{comment}{Pascal}{Free}> and C<$RE{comment}{Pascal}{GPC}> respectively. These patterns only set C<$1> when C<{-keep}> is used, which will then include the entire comment. See L, L and L. =item C<$RE{comment}{Pascal}{Workshop}> The I compiler, from SUN Microsystems, allows comments that are delimited with either C<{> and C<}>, delimited with C<(*)> and C<*>), delimited with C, and C<*/>, or starting and ending with a double quote (C<">). When C<{-keep}> is used, only C<$1> is set, and returns the entire comment. See L. =back =item PEARL Comments in I start with a C and last till the end of the line, or start with C and end with C<*/>. With C<{-keep}>, C<$1> will be set to the entire comment. =item PHP Comments in I start with either C<#> or C and last till the end of the line, or are delimited by C and C<*/>. With C<{-keep}>, C<$1> will be set to the entire comment. =item PL/B In I, comments start with either C<.> or C<;>, and end with the next newline. See L. =item PL/I The I language has comments starting with C and ending with C<*/>. =item PL/SQL In I, comments either start with C<--> and run till the end of the line, or start with C and end with C<*/>. =item Perl I uses comments that start with a C<#>, and continue till the end of the line. =item Portia The I programming language has comments that start with C, and last till the end of the line. =item Python I uses comments that start with a C<#>, and continue till the end of the line. =item Q-BAL Comments in the I language start with C<`> (a backtick), and contine till the end of the line. =item QML In C, comments start with C<#> and last till the end of the line. See L. =item R The statistical language I uses comments that start with a C<#> and end with the following new line. See L. =item REBOL Comments for the I language start with C<;> and last till the end of the line. =item Ruby Comments in I start with C<#> and last till the end of the time. =item Scheme I comments start with C<;>, and last till the end of the line. See L. =item shell Comments in various Is start with a C<#> and end at the end of the line. =item Shelta The esotoric language I uses comments that start and end with a C<;>. See L. =item SLIDE The I language has two froms of comments. First there is the line comment, which starts with a C<#> and includes the rest of the line (just like Perl). Second, there is the multiline, nested comment, which are delimited by C<(*> and C<*)>. Under C{-keep}>, only C<$1> is set, and is set to the entire comment. See L. =item slrn Configuration files for I have comments starting with a C<%> and lasting the rest of the line. =item Smalltalk I uses comments that start and end with a double quote, C<">. =item SMITH Comments in the I language start with C<;>, and last till the end of the line. =item Squeak In the Smalltalk variant I, comments start and end with C<">. Double quotes can appear inside comments by doubling them. =item SQL Standard I uses comments starting with two or more dashes, and ending at the end of the line. I does not follow the standard. Instead, it allows comments that start with a C<#> or C<-- > (that's two dashes and a space) ending with the following newline, and comments starting with C, and ending with the next C<;> or C<*/> that isn't inside single or double quotes. A pattern for this is returned by C<$RE{comment}{SQL}{MySQL}>. With C<{-keep}>, only C<$1> will be set, and it returns the entire comment. =item Tcl In I, comments start with C<#> and continue till the end of the line. =item TeX The documentation language I uses comments starting with C<%> and ending at the end of the line. =item troff The document formatting language I uses comments starting with C<\">, and continuing till the end of the line. =item Ubercode The Windows programming language I uses comments that start with C and continue to the end of the line. See L. =item vi In configuration files for the editor I, one can use comments starting with C<">, and ending at the end of the line. =item *W In the language I<*W>, comments start with C<||>, and end with C. =item zonefile Comments in DNS Is start with C<;>, and continue till the end of the line. =item ZZT-OOP The in-game language I uses comments that start with a C<'> character, and end at the following newline. See L. =back =head1 REFERENCES =over 4 =item B<[Go 90]> Charles F. Goldfarb: I. Oxford: Oxford University Press. B<1990>. ISBN 0-19-853737-9. Ch. 10.3, pp 390-391. =back =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]؉ڗCommon/balanced.pmnu6$package Regexp::Common::balanced; { use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; my %closer = ( '{'=>'}', '('=>')', '['=>']', '<'=>'>' ); my %cache; sub nested { my ($start, $finish) = @_; return $cache {$start} {$finish} if exists $cache {$start} {$finish}; my @starts = map {s/\\(.)/$1/g; $_} grep {length} $start =~ /([^|\\]+|\\.)+/gs; my @finishes = map {s/\\(.)/$1/g; $_} grep {length} $finish =~ /([^|\\]+|\\.)+/gs; push @finishes => ($finishes [-1]) x (@starts - @finishes); my @re; local $" = "|"; foreach my $begin (@starts) { my $end = shift @finishes; my $qb = quotemeta $begin; my $qe = quotemeta $end; my $fb = quotemeta substr $begin => 0, 1; my $fe = quotemeta substr $end => 0, 1; my $tb = quotemeta substr $begin => 1; my $te = quotemeta substr $end => 1; my $add; if ($fb eq $fe) { push @re => qq /(?:$qb(?:(?>[^$fb]+)|$fb(?!$tb)(?!$te)|(?-1))*$qe)/; } else { my @clauses = "(?>[^$fb$fe]+)"; push @clauses => "$fb(?!$tb)" if length $tb; push @clauses => "$fe(?!$te)" if length $te; push @clauses => "(?-1)"; push @re => qq /(?:$qb(?:@clauses)*$qe)/; } } $cache {$start} {$finish} = qr /(@re)/; } pattern name => [qw /balanced -parens=() -begin= -end=/], create => sub { my $flag = $_[1]; unless (defined $flag -> {-begin} && length $flag -> {-begin} && defined $flag -> {-end} && length $flag -> {-end}) { my @open = grep {index ($flag->{-parens}, $_) >= 0} ('[','(','{','<'); my @close = map {$closer {$_}} @open; $flag -> {-begin} = join "|" => @open; $flag -> {-end} = join "|" => @close; } return nested @$flag {qw /-begin -end/}; }, ; } 1; __END__ =pod =head1 NAME Regexp::Common::balanced -- provide regexes for strings with balanced parenthesized delimiters or arbitrary delimiters. =head1 SYNOPSIS use Regexp::Common qw /balanced/; while (<>) { /$RE{balanced}{-parens=>'()'}/ and print q{balanced parentheses\n}; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. =head2 C<$RE{balanced}{-parens}> Returns a pattern that matches a string that starts with the nominated opening parenthesis or bracket, contains characters and properly nested parenthesized subsequences, and ends in the matching parenthesis. More than one type of parenthesis can be specified: $RE{balanced}{-parens=>'(){}'} in which case all specified parenthesis types must be correctly balanced within the string. Since version 2013030901, C<< $1 >> will always be set (to the entire matched substring), regardless whether C<< {-keep} >> is used or not. =head2 C<< $RE{balanced}{-begin => "begin"}{-end => "end"} >> Returns a pattern that matches a string that is properly balanced using the I and I strings as start and end delimiters. Multiple sets of begin and end strings can be given by separating them by C<|>s (which can be escaped with a backslash). qr/$RE{balanced}{-begin => "do|if|case"}{-end => "done|fi|esac"}/ will match properly balanced strings that either start with I and end with I, start with I and end with I, or start with I and end with I. If I<-end> contains less cases than I<-begin>, the last case of I<-end> is repeated. If it contains more cases than I<-begin>, the extra cases are ignored. If either of I<-begin> or I<-end> isn't given, or is empty, I<< -begin => '(' >> and I<< -end => ')' >> are assumed. Since version 2013030901, C<< $1 >> will always be set (to the entire matched substring), regardless whether C<< {-keep} >> is used or not. =head2 Note Since version 2013030901 the pattern will make of the recursive construct C<< (?-1) >>, instead of using the problematic C<< (??{ }) >> construct. This fixes an problem that was introduced in the 5.17 development track. =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK] Common/list.pmnu6$package Regexp::Common::list; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; sub gen_list_pattern { my ($pat, $sep, $lsep) = @_; $lsep = $sep unless defined $lsep; return "(?k:(?:(?:$pat)(?:$sep))*(?:$pat)(?k:$lsep)(?:$pat))"; } my $defpat = '.*?\S'; my $defsep = '\s*,\s*'; pattern name => ['list', "-pat=$defpat", "-sep=$defsep", '-lastsep'], create => sub {gen_list_pattern (@{$_[1]}{-pat, -sep, -lastsep})}, ; pattern name => ['list', 'conj', '-word=(?:and|or)'], create => sub {gen_list_pattern($defpat, $defsep, '\s*,?\s*'.$_[1]->{-word}.'\s*'); }, ; pattern name => ['list', 'and'], create => sub {gen_list_pattern ($defpat, $defsep, '\s*,?\s*and\s*')}, ; pattern name => ['list', 'or'], create => sub {gen_list_pattern ($defpat, $defsep, '\s*,?\s*or\s*')}, ; 1; __END__ =pod =head1 NAME Regexp::Common::list -- provide regexes for lists =head1 SYNOPSIS use Regexp::Common qw /list/; while (<>) { /$RE{list}{-pat => '\w+'}/ and print "List of words"; /$RE{list}{-pat => $RE{num}{real}}/ and print "List of numbers"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. =head2 C<$RE{list}{-pat}{-sep}{-lastsep}> Returns a pattern matching a list of (at least two) substrings. If C<-pat=I

> is specified, it defines the pattern for each substring in the list. By default, I

is C. In Regexp::Common 0.02 or earlier, the default pattern was C. But that will match a single space, causing unintended parsing of C as a list of four elements instead of 3 (with C<-word> being C<(?:and)>). One consequence is that a list of the form "a,,b" will no longer be parsed. Use the pattern C to be able to parse this, but see the previous remark. If C<-sep=I

> is specified, it defines the pattern I

to be used as a separator between each pair of substrings in the list, except the final two. By default I

is C. If C<-lastsep=I

> is specified, it defines the pattern I

to be used as a separator between the final two substrings in the list. By default I

is the same as the pattern specified by the C<-sep> flag. For example: $RE{list}{-pat=>'\w+'} # match a list of word chars $RE{list}{-pat=>$RE{num}{real}} # match a list of numbers $RE{list}{-sep=>"\t"} # match a tab-separated list $RE{list}{-lastsep=>',\s+and\s+'} # match a proper English list Under C<-keep>: =over 4 =item $1 captures the entire list =item $2 captures the last separator =back =head2 C<$RE{list}{conj}{-word=I}> An alias for C<< $RE{list}{-lastsep=>'\s*,?\s*I\s*'} >> If C<-word> is not specified, the default pattern is C. For example: $RE{list}{conj}{-word=>'et'} # match Jean, Paul, et Satre $RE{list}{conj}{-word=>'oder'} # match Bonn, Koln oder Hamburg =head2 C<$RE{list}{and}> An alias for C<< $RE{list}{conj}{-word=>'and'} >> =head2 C<$RE{list}{or}> An alias for C<< $RE{list}{conj}{-word=>'or'} >> =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]F7 7 Common/CC.pmnu6$package Regexp::Common::CC; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::_support qw /luhn/; our $VERSION = '2024080801'; my @cards = ( # Name Prefix Length mod 10 [Mastercard => '5[1-5]', 16, 1], [Visa => '4', [13, 16], 1], [Amex => '3[47]', 15, 1], # Carte Blanche ['Diners Club' => '3(?:0[0-5]|[68])', 14, 1], [Discover => '6011', 16, 1], [enRoute => '2(?:014|149)', 15, 0], [JCB => [['3', 16, 1], ['2131|1800', 15, 1]]], ); foreach my $card (@cards) { my ($name, $prefix, $length, $mod) = @$card; # Skip the harder ones for now. next if ref $prefix || ref $length; next unless $mod; my $times = $length + $mod; pattern name => [CC => $name], create => sub { use re 'eval'; qr <((?=($prefix))[0-9]{$length}) (?(?{Regexp::Common::_support::luhn $1})|(?!))>x } ; } 1; __END__ =pod =head1 NAME Regexp::Common::CC -- provide patterns for credit card numbers. =head1 SYNOPSIS use Regexp::Common qw /CC/; while (<>) { /^$RE{CC}{Mastercard}$/ and print "Mastercard card number\n"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. This module offers patterns for credit card numbers of several major credit card types. Currently, the supported cards are: I, I, I, and I. =head1 SEE ALSO L for a general description of how to use this interface. =over 4 =item L Credit Card Validation - Check Digits =item L Everything you ever wanted to know about CC's =item L Luhn formula =back =head1 AUTHORS Damian Conway S<(I)> and Abigail S<(I)>. =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. Send them in to S>. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]WmW  Common/_support.pmnu6$package Regexp::Common::_support; use 5.10.0; use strict; use warnings; no warnings 'syntax'; our $VERSION = '2024080801'; # # Returns true/false, depending whether the given the argument # satisfies the LUHN checksum. # See http://www.webopedia.com/TERM/L/Luhn_formula.html. # # Note that this function is intended to be called from regular # expression, so it should NOT use a regular expression in any way. # sub luhn { my $arg = shift; my $even = 0; my $sum = 0; while (length $arg) { my $num = chop $arg; return if $num lt '0' || $num gt '9'; if ($even && (($num *= 2) > 9)) {$num = 1 + ($num % 10)} $even = 1 - $even; $sum += $num; } !($sum % 10) } sub import { my $pack = shift; my $caller = caller; no strict 'refs'; *{$caller . "::" . $_} = \&{$pack . "::" . $_} for @_; } 1; __END__ =pod =head1 NAME Regexp::Common::support -- Support functions for Regexp::Common. =head1 SYNOPSIS use Regexp::Common::_support qw /luhn/; luhn ($number) # Returns true/false. =head1 DESCRIPTION This module contains some subroutines to be used by other C modules. It's not intended to be used directly. Subroutines from the module may disappear without any notice, or their meaning or interface may change without notice. =over 4 =item luhn This subroutine returns true if its argument passes the luhn checksum test. =back =head1 SEE ALSO L. =head1 AUTHOR Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]R}33 Common/net.pmnu6$package Regexp::Common::net; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; my %IPunit = ( dec => q{(?k:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})}, oct => q{(?k:[0-3]?[0-7]{1,2})}, hex => q{(?k:[0-9a-fA-F]{1,2})}, bin => q{(?k:[0-1]{1,8})}, strict => q{(?k:2(?:5[0-5]?|[0-4][0-9]?|[6-9]?)|1[0-9]{0,2}|[3-9][0-9]?|0)}, ); my %MACunit = ( %IPunit, hex => q{(?k:[0-9a-fA-F]{1,2})}, ); my %IPv6unit = ( hex => q {(?k:[0-9a-f]{1,4})}, HEX => q {(?k:[0-9A-F]{1,4})}, HeX => q {(?k:[0-9a-fA-F]{1,4})}, ); sub dec {$_}; sub bin {oct "0b$_"} my $IPdefsep = '[.]'; my $MACdefsep = ':'; my $IPv6defsep = ':'; pattern name => [qw (net IPv4)], create => "(?k:$IPunit{dec}$IPdefsep$IPunit{dec}$IPdefsep" . "$IPunit{dec}$IPdefsep$IPunit{dec})", ; pattern name => [qw (net MAC)], create => "(?k:" . join ($MACdefsep => ($MACunit{hex}) x 6) . ")", subs => sub { $_ [1] = join ":" => map {sprintf "%02x" => hex} split /$MACdefsep/ => $_ [1] if $_ [1] =~ /$_[0]/ }, ; foreach my $type (qw /dec oct hex bin strict/) { pattern name => [qw (net IPv4), $type, "-sep=$IPdefsep"], create => sub {my $sep = $_ [1] -> {-sep}; "(?k:$IPunit{$type}$sep$IPunit{$type}$sep" . "$IPunit{$type}$sep$IPunit{$type})" }, ; pattern name => [qw (net MAC), $type, "-sep=$MACdefsep"], create => sub {my $sep = $_ [1] -> {-sep}; "(?k:" . join ($sep => ($MACunit{$type}) x 6) . ")", }, subs => sub { return if $] < 5.006 and $type eq 'bin'; $_ [1] = join ":" => map {sprintf "%02x" => eval $type} $2, $3, $4, $5, $6, $7 if $_ [1] =~ $RE {net} {MAC} {$type} {-sep => $_ [0] -> {flags} {-sep}} {-keep}; }, ; } my %cache6; pattern name => [qw (net IPv6), "-sep=$IPv6defsep", "-style=HeX"], create => sub { my $style = $_ [1] {-style}; my $sep = $_ [1] {-sep}; return $cache6 {$style, $sep} if $cache6 {$style, $sep}; my @re; die "Impossible style '$style'\n" unless exists $IPv6unit {$style}; # # Nothing missing # push @re => join $sep => ($IPv6unit {$style}) x 8; # # For "double colon" representations, at least 2 units must # be omitted, leaving us with at most 6 units. 0 units is also # possible. Note we can have at most one double colon. # for (my $l = 0; $l <= 6; $l ++) { # # We prefer to do longest match, so larger $r gets priority # for (my $r = 6 - $l; $r >= 0; $r --) { # # $l is the number of blocks left of the double colon, # $r is the number of blocks left of the double colon, # $m is the number of omitted blocks # my $m = 8 - $l - $r; my $patl = $l ? ($IPv6unit {$style} . $sep) x $l : $sep; my $patr = $r ? ($sep . $IPv6unit {$style}) x $r : $sep; my $patm = "(?k:)" x $m; my $pat = $patl . $patm . $patr; push @re => "(?:$pat)"; } } local $" = "|"; $cache6 {$style, $sep} = qq /(?k:(?|@re))/; }, ; my $letter = "[A-Za-z]"; my $let_dig = "[A-Za-z0-9]"; my $let_dig_hyp = "[-A-Za-z0-9]"; # Domain names, from RFC 1035. pattern name => [qw (net domain -nospace= -rfc1101=)], create => sub { my $rfc1101 = exists $_ [1] {-rfc1101} && !defined $_ [1] {-rfc1101}; my $lead = $rfc1101 ? "(?!$RE{net}{IPv4}(?:[.]|\$))$let_dig" : $letter; if (exists $_ [1] {-nospace} && !defined $_ [1] {-nospace}) { return "(?k:$lead(?:(?:$let_dig_hyp){0,61}$let_dig)?" . "(?:\\.$lead(?:(?:$let_dig_hyp){0,61}$let_dig)?)*)" } else { return "(?k: |(?:$lead(?:(?:$let_dig_hyp){0,61}$let_dig)?" . "(?:\\.$lead(?:(?:$let_dig_hyp){0,61}$let_dig)?)*))" } }, ; 1; __END__ =head1 NAME Regexp::Common::net -- provide regexes for IPv4, IPv6, and MAC addresses. =head1 SYNOPSIS use Regexp::Common qw /net/; while (<>) { /$RE{net}{IPv4}/ and print "Dotted decimal IP address"; /$RE{net}{IPv4}{hex}/ and print "Dotted hexadecimal IP address"; /$RE{net}{IPv4}{oct}{-sep => ':'}/ and print "Colon separated octal IP address"; /$RE{net}{IPv4}{bin}/ and print "Dotted binary IP address"; /$RE{net}{MAC}/ and print "MAC address"; /$RE{net}{MAC}{oct}{-sep => " "}/ and print "Space separated octal MAC address"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. This modules gives you regular expressions for various style IPv4, IPv6, and MAC (or ethernet) addresses. =head2 C<$RE{net}{IPv4}> Returns a pattern that matches a valid IP address in "dotted decimal". Note that while C<318.99.183.11> is not a valid IP address, it does match C, but this is because C<318.99.183.11> contains a valid IP address, namely C<18.99.183.11>. To prevent the unwanted matching, one needs to anchor the regexp: C. For this pattern and the next four, under C<-keep> (See L): =over 4 =item $1 captures the entire match =item $2 captures the first component of the address =item $3 captures the second component of the address =item $4 captures the third component of the address =item $5 captures the final component of the address =back =head2 C<$RE{net}{IPv4}{dec}{-sep}> Returns a pattern that matches a valid IP address in "dotted decimal". Leading 0s are allowed, as long as each component does not exceed 3 digits. If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. =head2 C<$RE{net}{IPv4}{strict}{-sep}> Returns a pattern that matches a valid IP address in "dotted decimal", but disallow any leading 0s. If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. =head2 C<$RE{net}{IPv4}{hex}{-sep}> Returns a pattern that matches a valid IP address in "dotted hexadecimal", with the letters C to C capitalized. If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. C<< -sep="" >> and C<< -sep=" " >> are useful alternatives. =head2 C<$RE{net}{IPv4}{oct}{-sep}> Returns a pattern that matches a valid IP address in "dotted octal" If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. =head2 C<$RE{net}{IPv4}{bin}{-sep}> Returns a pattern that matches a valid IP address in "dotted binary" If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. =head2 C<$RE{net}{MAC}> Returns a pattern that matches a valid MAC or ethernet address as colon separated hexadecimals. For this pattern, and the next four, under C<-keep> (See L): =over 4 =item $1 captures the entire match =item $2 captures the first component of the address =item $3 captures the second component of the address =item $4 captures the third component of the address =item $5 captures the fourth component of the address =item $6 captures the fifth component of the address =item $7 captures the sixth and final component of the address =back This pattern, and the next four, have a C method as well, which will transform a matching MAC address into so called canonical format. Canonical format means that every component of the address will be exactly two hexadecimals (with a leading zero if necessary), and the components will be separated by a colon. =head2 C<$RE{net}{MAC}{dec}{-sep}> Returns a pattern that matches a valid MAC address as colon separated decimals. If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. =head2 C<$RE{net}{MAC}{hex}{-sep}> Returns a pattern that matches a valid MAC address as colon separated hexadecimals, with the letters C to C in lower case. If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. =head2 C<$RE{net}{MAC}{oct}{-sep}> Returns a pattern that matches a valid MAC address as colon separated octals. If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. =head2 C<$RE{net}{MAC}{bin}{-sep}> Returns a pattern that matches a valid MAC address as colon separated binary numbers. If C<< -sep=I

>> is specified the pattern I

is used as the separator. By default I

is C. =head2 C<< $RE{net}{IPv6}{-sep => ':'}{-style => 'HeX'} >> Returns a pattern matching IPv6 numbers. An IPv6 address consists of eight groups of four hexadecimal digits, separated by colons. In each group, leading zeros may be omitted. Two or more consecutive groups consisting of only zeros may be omitted (including any colons separating them), resulting into two sets of groups, separated by a double colon. (Each of the groups may be empty; C<< :: >> is a valid address, equal to C<< 0000:0000:0000:0000:0000:0000:0000:0000 >>). The hex numbers may be in either case. If the C<< -sep >> option is used, its argument is a pattern that matches the separator that separates groups. This defaults to C<< : >>. The C<< -style >> option is used to denote which case the hex numbers may be. The default style, C<< 'HeX' >> indicates both lower case letters C<< 'a' >> to C<< 'f' >> and upper case letters C<< 'A' >> to C<< 'F' >> will be matched. The style C<< 'HEX' >> restricts matching to upper case letters, and C<< 'hex' >> only matches lower case letters. If C<< {-keep} >> is used, C<< $1 >> to C<< $9 >> will be set. C<< $1 >> will be set to the matched address, while C<< $2 >> to C<< $9 >> will be set to each matched group. If a group is omitted because it contains all zeros, its matching variable will be the empty string. Example: "2001:db8:85a3::8a2e:370:7334" =~ /$RE{net}{IPv6}{-keep}/; print $2; # '2001' print $4; # '85a3' print $6; # Empty string print $8; # '370' Perl 5.10 (or later) is required for this pattern. =head2 C<$RE{net}{domain}> Returns a pattern to match domains (and hosts) as defined in RFC 1035. Under I{-keep} only the entire domain name is returned. RFC 1035 says that a single space can be a domainname too. So, the pattern returned by C<$RE{net}{domain}> recognizes a single space as well. This is not always what people want. If you want to recognize domainnames, but not a space, you can do one of two things, either use /(?! )$RE{net}{domain}/ or use the C<{-nospace}> option (without an argument). RFC 1035 does B allow host or domain names to start with a digits; however, this restriction is relaxed in RFC 1101; this RFC allows host and domain names to start with a digit, as long as the first part of a domain does not look like an IP address. If the C<< {-rfc1101} >> option is given (as in C<< $RE {net} {domain} {-rfc1101} >>), we will match using the relaxed rules. =head1 REFERENCES =over 4 =item B Mockapetris, P.: I. November 1987. =item B Mockapetris, P.: I. April 1987. =back =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway I. =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]-t Common/URI/news.pmnu6$package Regexp::Common::URI::news; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC1738 qw /$grouppart $group $article $host $port $digits/; use strict; use warnings; our $VERSION = '2024080801'; my $news_scheme = 'news'; my $news_uri = "(?k:(?k:$news_scheme):(?k:$grouppart))"; my $nntp_scheme = 'nntp'; my $nntp_uri = "(?k:(?k:$nntp_scheme)://(?k:(?k:(?k:$host)(?::(?k:$port))?)" . "/(?k:$group)(?:/(?k:$digits))?))"; register_uri $news_scheme => $news_uri; register_uri $nntp_scheme => $nntp_uri; pattern name => [qw (URI news)], create => $news_uri, ; pattern name => [qw (URI NNTP)], create => $nntp_uri, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::news -- Returns a pattern for file URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{news}/ and print "Contains a news URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{news} Returns a pattern that matches I URIs, as defined by RFC 1738. News URIs have the form: "news:" ( "*" | group | article "@" host ) Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The scheme. =item $3 The part of the URI following "news://". =back =head2 $RE{URI}{NNTP} Returns a pattern that matches I URIs, as defined by RFC 1738. NNTP URIs have the form: "nntp://" host [ ":" port ] "/" group [ "/" digits ] Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The scheme. =item $3 The part of the URI following "nntp://". =item $4 The host and port, separated by a colon. If no port was given, just the host. =item $5 The host. =item $6 The port, if given. =item $7 The group. =item $8 The digits, if given. =back =head1 REFERENCES =over 4 =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]MGICommon/URI/telnet.pmnu6$package Regexp::Common::URI::telnet; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC1738 qw /$user $password $host $port/; use strict; use warnings; our $VERSION = '2024080801'; my $telnet_uri = "(?k:(?k:telnet)://(?:(?k:(?k:$user)(?::(?k:$password))?)\@)?" . "(?k:(?k:$host)(?::(?k:$port))?)(?k:/)?)"; register_uri telnet => $telnet_uri; pattern name => [qw (URI telnet)], create => $telnet_uri, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::telnet -- Returns a pattern for telnet URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{telnet}/ and print "Contains a telnet URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{telnet} Returns a pattern that matches I URIs, as defined by RFC 1738. Telnet URIs have the form: "telnet:" "//" [ user [ ":" password ] "@" ] host [ ":" port ] [ "/" ] Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The scheme. =item $3 The username:password combo, or just the username if there is no password. =item $4 The username, if given. =item $5 The password, if given. =item $6 The host:port combo, or just the host if there's no port. =item $7 The host. =item $8 The port, if given. =item $9 The trailing slash, if any. =back =head1 REFERENCES =over 4 =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]TpwwCommon/URI/ftp.pmnu6$package Regexp::Common::URI::ftp; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC2396 qw /$host $port $ftp_segments $userinfo $userinfo_no_colon/; use strict; use warnings; our $VERSION = '2024080801'; my $ftp_uri = "(?k:(?k:ftp)://(?:(?k:$userinfo)(?k:)\@)?(?k:$host)" . "(?::(?k:$port))?(?k:/(?k:(?k:$ftp_segments)" . "(?:;type=(?k:[AIai]))?))?)"; my $ftp_uri_password = "(?k:(?k:ftp)://(?:(?k:$userinfo_no_colon)" . "(?::(?k:$userinfo_no_colon))?\@)?(?k:$host)" . "(?::(?k:$port))?(?k:/(?k:(?k:$ftp_segments)" . "(?:;type=(?k:[AIai]))?))?)"; register_uri FTP => $ftp_uri; pattern name => [qw (URI FTP), "-type=[AIai]", "-password="], create => sub { my $uri = exists $_ [1] -> {-password} && !defined $_ [1] -> {-password} ? $ftp_uri_password : $ftp_uri; my $type = $_ [1] -> {-type}; $uri =~ s/\[AIai\]/$type/; $uri; } ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::ftp -- Returns a pattern for FTP URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{FTP}/ and print "Contains an FTP URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{FTP}{-type}{-password}; Returns a regex for FTP URIs. Note: FTP URIs are not formally defined. RFC 1738 defines FTP URLs, but parts of that RFC have been obsoleted by RFC 2396. However, the differences between RFC 1738 and RFC 2396 are such that they aren't applicable straightforwardly to FTP URIs. There are two main problems: =over 4 =item Passwords. RFC 1738 allowed an optional username and an optional password (separated by a colon) in the FTP URL. Hence, colons were not allowed in either the username or the password. RFC 2396 strongly recommends passwords should not be used in URIs. It does allow for I instead. This userinfo part may contain colons, and hence contain more than one colon. The regexp returned follows the RFC 2396 specification, unless the I<{-password}> option is given; then the regex allows for an optional username and password, separated by a colon. =item The ;type specifier. RFC 1738 does not allow semi-colons in FTP path names, because a semi-colon is a reserved character for FTP URIs. The semi-colon is used to separate the path from the option I specifier. However, in RFC 2396, paths consist of slash separated segments, and each segment is a semi-colon separated group of parameters. Straigthforward application of RFC 2396 would mean that a trailing I specifier couldn't be distinguished from the last segment of the path having a two parameters, the last one starting with I. Therefore we have opted to disallow a semi-colon in the path part of an FTP URI. Furthermore, RFC 1738 allows three values for the type specifier, I, I and I (either upper case or lower case). However, the internet draft about FTP URIs B<[DRAFT-FTP-URL]> (which expired in May 1997) notes the lack of consistent implementation of the I parameter and drops I from the set of possible values. We follow this practise; however, RFC 1738 behaviour can be archieved by using the I<-type => "[ADIadi]"> parameter. =back FTP URIs have the following syntax: "ftp:" "//" [ userinfo "@" ] host [ ":" port ] [ "/" path [ ";type=" value ]] When using I<{-password}>, we have the syntax: "ftp:" "//" [ user [ ":" password ] "@" ] host [ ":" port ] [ "/" path [ ";type=" value ]] Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The scheme. =item $3 The userinfo, or if I<{-password}> is used, the username. =item $4 If I<{-password}> is used, the password, else C. =item $5 The hostname or IP address. =item $6 The port number. =item $7 The full path and type specification, including the leading slash. =item $8 The full path and type specification, without the leading slash. =item $9 The full path, without the type specification nor the leading slash. =item $10 The value of the type specification. =back =head1 REFERENCES =over 4 =item B<[DRAFT-URL-FTP]> Casey, James: I. November 1996. =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =item B<[RFC 2396]> Berners-Lee, Tim, Fielding, R., and Masinter, L.: I. August 1998. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]=# Common/URI/fax.pmnu6$package Regexp::Common::URI::fax; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC2806 qw /$fax_subscriber $fax_subscriber_no_future/; use strict; use warnings; our $VERSION = '2024080801'; my $fax_scheme = 'fax'; my $fax_uri = "(?k:(?k:$fax_scheme):(?k:$fax_subscriber))"; my $fax_uri_nf = "(?k:(?k:$fax_scheme):(?k:$fax_subscriber_no_future))"; register_uri $fax_scheme => $fax_uri; pattern name => [qw (URI fax)], create => $fax_uri ; pattern name => [qw (URI fax nofuture)], create => $fax_uri_nf ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::fax -- Returns a pattern for fax URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{fax}/ and print "Contains a fax URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{fax} Returns a pattern that matches I URIs, as defined by RFC 2806. Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The scheme. =item $3 The phone number, including any possible add-ons like ISDN subaddress, a post dial part, area specifier, service provider, etc. =back =head2 C<$RE{URI}{fax}{nofuture}> As above (including what's returned by C<{-keep}>), with the exception that I are not allowed. Without allowing those I, it becomes much easier to check a URI if the correct syntax for post dial, service provider, phone context, etc has been used - otherwise the regex could always classify them as a I. =head1 REFERENCES =over 4 =item B<[RFC 1035]> Mockapetris, P.: I. November 1987. =item B<[RFC 2396]> Berners-Lee, Tim, Fielding, R., and Masinter, L.: I. August 1998. =item B<[RFC 2806]> Vaha-Sipila, A.: I. April 2000. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK] Common/URI/RFC2806.pmnu6$package Regexp::Common::URI::RFC2806; use Regexp::Common::URI::RFC1035 qw /$domain/; use Regexp::Common::URI::RFC2396 qw /$unreserved $escaped $hex/; use strict; use warnings; our $VERSION = '2024080801'; use Exporter (); our @ISA = qw /Exporter/; my %vars; BEGIN { $vars {low} = [qw /$dtmf_digit $wait_for_dial_tone $one_second_pause $pause_character $visual_separator $phonedigit $escaped_no_dquote $quoted_string $token_char $token_chars/]; $vars {parts} = [qw /$future_extension/]; $vars {connect} = [qw /$provider_hostname $provider_tag $service_provider $private_prefix $local_network_prefix $global_network_prefix $network_prefix/]; $vars {phone} = [qw /$phone_context_ident $phone_context_tag $area_specifier $post_dial $isdn_subaddress $t33_subaddress $local_phone_number $local_phone_number_no_future $base_phone_number $global_phone_number $global_phone_number_no_future $telephone_subscriber $telephone_subscriber_no_future/]; $vars {fax} = [qw /$fax_local_phone $fax_local_phone_no_future $fax_global_phone $fax_global_phone_no_future $fax_subscriber $fax_subscriber_no_future/]; $vars {modem} = [qw //]; } our @EXPORT = (); our @EXPORT_OK = map {@$_} values %vars; our %EXPORT_TAGS = (%vars, ALL => [@EXPORT_OK]); # RFC 2806, URIs for tel, fax & modem. our $dtmf_digit = "(?:[*#ABCD])"; our $wait_for_dial_tone= "(?:w)"; our $one_second_pause = "(?:p)"; our $pause_character = "(?:[wp])"; # wait_for_dial_tone | one_second_pause. our $visual_separator = "(?:[\\-.()])"; our $phonedigit = "(?:[0-9\\-.()])"; # DIGIT | visual_separator our $escaped_no_dquote = "(?:%(?:[01]$hex)|2[013-9A-Fa-f]|[3-9A-Fa-f]$hex)"; our $quoted_string = "(?:%22(?:(?:%5C(?:$unreserved|$escaped))|" . "$unreserved+|$escaped_no_dquote)*%22)"; # It is unclear wether we can allow only unreserved # characters to unescaped, or can we also use uric # characters that are unescaped? Or pchars? our $token_char = "(?:[!'*\\-.0-9A-Z_a-z~]|" . "%(?:2[13-7ABDEabde]|3[0-9]|4[1-9A-Fa-f]|" . "5[AEFaef]|6[0-9A-Fa-f]|7[0-9ACEace]))"; # Only allowing unreserved chars to be unescaped. our $token_chars = "(?:(?:[!'*\\-.0-9A-Z_a-z~]+|" . "%(?:2[13-7ABDEabde]|3[0-9]|4[1-9A-Fa-f]|" . "5[AEFaef]|6[0-9A-Fa-f]|7[0-9ACEace]))*)"; our $future_extension = "(?:;$token_chars" . "(?:=(?:(?:$token_chars(?:[?]$token_chars)?)|" . "$quoted_string))?)"; our $provider_hostname = $domain; our $provider_tag = "(?:tsp)"; our $service_provider = "(?:;$provider_tag=$provider_hostname)"; our $private_prefix = "(?:(?:[!'E-OQ-VX-Z_e-oq-vx-z~]|" . "(?:%(?:2[124-7CFcf]|3[AC-Fac-f]|4[05-9A-Fa-f]|" . "5[1-689A-Fa-f]|6[05-9A-Fa-f]|" . "7[1-689A-Ea-e])))" . "(?:[!'()*\\-.0-9A-Z_a-z~]+|" . "(?:%(?:2[1-9A-Fa-f]|3[AC-Fac-f]|" . "[4-6][0-9A-Fa-f]|7[0-9A-Ea-e])))*)"; our $local_network_prefix = "(?:[0-9\\-.()*#ABCDwp]+)"; our $global_network_prefix = "(?:[+][0-9\\-.()]+)"; our $network_prefix = "(?:$global_network_prefix|$local_network_prefix)"; our $phone_context_ident = "(?:$network_prefix|$private_prefix)"; our $phone_context_tag = "(?:phone-context)"; our $area_specifier = "(?:;$phone_context_tag=$phone_context_ident)"; our $post_dial = "(?:;postd=[0-9\\-.()*#ABCDwp]+)"; our $isdn_subaddress = "(?:;isub=[0-9\\-.()]+)"; our $t33_subaddress = "(?:;tsub=[0-9\\-.()]+)"; our $local_phone_number= "(?:[0-9\\-.()*#ABCDwp]+$isdn_subaddress?" . "$post_dial?$area_specifier" . "(?:$area_specifier|$service_provider|" . "$future_extension)*)"; our $local_phone_number_no_future = "(?:[0-9\\-.()*#ABCDwp]+$isdn_subaddress?" . "$post_dial?$area_specifier" . "(?:$area_specifier|$service_provider)*)"; our $fax_local_phone = "(?:[0-9\\-.()*#ABCDwp]+$isdn_subaddress?" . "$t33_subaddress?$post_dial?$area_specifier" . "(?:$area_specifier|$service_provider|" . "$future_extension)*)"; our $fax_local_phone_no_future = "(?:[0-9\\-.()*#ABCDwp]+$isdn_subaddress?" . "$t33_subaddress?$post_dial?$area_specifier" . "(?:$area_specifier|$service_provider)*)"; our $base_phone_number = "(?:[0-9\\-.()]+)"; our $global_phone_number = "(?:[+]$base_phone_number$isdn_subaddress?" . "$post_dial?" . "(?:$area_specifier|$service_provider|" . "$future_extension)*)"; our $global_phone_number_no_future = "(?:[+]$base_phone_number$isdn_subaddress?" . "$post_dial?" . "(?:$area_specifier|$service_provider)*)"; our $fax_global_phone = "(?:[+]$base_phone_number$isdn_subaddress?" . "$t33_subaddress?$post_dial?" . "(?:$area_specifier|$service_provider|" . "$future_extension)*)"; our $fax_global_phone_no_future = "(?:[+]$base_phone_number$isdn_subaddress?" . "$t33_subaddress?$post_dial?" . "(?:$area_specifier|$service_provider)*)"; our $telephone_subscriber = "(?:$global_phone_number|$local_phone_number)"; our $telephone_subscriber_no_future = "(?:$global_phone_number_no_future|" . "$local_phone_number_no_future)"; our $fax_subscriber = "(?:$fax_global_phone|$fax_local_phone)"; our $fax_subscriber_no_future = "(?:$fax_global_phone_no_future|" . "$fax_local_phone_no_future)"; 1; __END__ =pod =head1 NAME Regexp::Common::URI::RFC2806 -- Definitions from RFC2806; =head1 SYNOPSIS use Regexp::Common::URI::RFC2806 qw /:ALL/; =head1 DESCRIPTION This package exports definitions from RFC2806. It's intended usage is for Regexp::Common::URI submodules only. Its interface might change without notice. =head1 REFERENCES =over 4 =item B<[RFC 2616]> Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P. and Berners-Lee, Tim: I. June 1999. =back =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]d\  Common/URI/pop.pmnu6$package Regexp::Common::URI::pop; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC1738 qw /$host $port/; use Regexp::Common::URI::RFC2384 qw /$enc_user $enc_auth_type/; use strict; use warnings; our $VERSION = '2024080801'; my $scheme = "pop"; my $uri = "(?k:(?k:$scheme)://(?:(?k:$enc_user)" . "(?:;AUTH=(?k:[*]|$enc_auth_type))?\@)?" . "(?k:$host)(?::(?k:$port))?)"; register_uri $scheme => $uri; pattern name => [qw (URI POP)], create => $uri, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::pop -- Returns a pattern for POP URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{POP}/ and print "Contains a POP URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{POP} Returns a pattern that matches I URIs, as defined by RFC 2384. POP URIs have the form: "pop:" "//" [ user [ ";AUTH" ( "*" | auth_type ) ] "@" ] host [ ":" port ] Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The I. =item $3 The I, if given. =item $4 The I, if given (could be a I<*>). =item $5 The I. =item $6 The I, if given. =back =head1 REFERENCES =over 4 =item B<[RFC 2384]> Gellens, R.: I. August 1998. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Abigail. (I). =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]v  Common/URI/RFC2384.pmnu6$package Regexp::Common::URI::RFC2384; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI::RFC1738 qw /$unreserved_range $escape $hostport/; use strict; use warnings; our $VERSION = '2024080801'; use Exporter (); our @ISA = qw /Exporter/; my %vars; BEGIN { $vars {low} = [qw /$achar_range $achar $achars $achar_more/]; $vars {connect} = [qw /$enc_sasl $enc_user $enc_ext $enc_auth_type $auth $user_auth $server/]; $vars {parts} = [qw /$pop_url/]; } our @EXPORT = qw /$host/; our @EXPORT_OK = map {@$_} values %vars; our %EXPORT_TAGS = (%vars, ALL => [@EXPORT_OK]); # RFC 2384, POP3. # Lowlevel definitions. our $achar_range = "$unreserved_range&=~"; our $achar = "(?:[$achar_range]|$escape)"; our $achars = "(?:(?:[$achar_range]+|$escape)*)"; our $achar_more = "(?:(?:[$achar_range]+|$escape)+)"; our $enc_sasl = $achar_more; our $enc_user = $achar_more; our $enc_ext = "(?:[+](?:APOP|$achar_more))"; our $enc_auth_type = "(?:$enc_sasl|$enc_ext)"; our $auth = "(?:;AUTH=(?:[*]|$enc_auth_type))"; our $user_auth = "(?:$enc_user$auth?)"; our $server = "(?:(?:$user_auth\@)?$hostport)"; our $pop_url = "(?:pop://$server)"; 1; __END__ =pod =head1 NAME Regexp::Common::URI::RFC2384 -- Definitions from RFC2384; =head1 SYNOPSIS use Regexp::Common::URI::RFC2384 qw /:ALL/; =head1 DESCRIPTION This package exports definitions from RFC2384. It's intended usage is for Regexp::Common::URI submodules only. Its interface might change without notice. =head1 REFERENCES =over 4 =item B<[RFC 2384]> Gellens, R.: I August 1998. =back =head1 AUTHOR Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]< Common/URI/tel.pmnu6$package Regexp::Common::URI::tel; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC2806 qw /$telephone_subscriber $telephone_subscriber_no_future/; use strict; use warnings; our $VERSION = '2024080801'; my $tel_scheme = 'tel'; my $tel_uri = "(?k:(?k:$tel_scheme):(?k:$telephone_subscriber))"; my $tel_uri_nf = "(?k:(?k:$tel_scheme):(?k:$telephone_subscriber_no_future))"; register_uri $tel_scheme => $tel_uri; pattern name => [qw (URI tel)], create => $tel_uri ; pattern name => [qw (URI tel nofuture)], create => $tel_uri_nf ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::tel -- Returns a pattern for telephone URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{tel}/ and print "Contains a telephone URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{tel} Returns a pattern that matches I URIs, as defined by RFC 2806. Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The scheme. =item $3 The phone number, including any possible add-ons like ISDN subaddress, a post dial part, area specifier, service provider, etc. =back =head2 C<$RE{URI}{tel}{nofuture}> As above (including what's returned by C<{-keep}>), with the exception that I are not allowed. Without allowing those I, it becomes much easier to check a URI if the correct syntax for post dial, service provider, phone context, etc has been used - otherwise the regex could always classify them as a I. =head1 REFERENCES =over 4 =item B<[RFC 1035]> Mockapetris, P.: I. November 1987. =item B<[RFC 2396]> Berners-Lee, Tim, Fielding, R., and Masinter, L.: I. August 1998. =item B<[RFC 2806]> Vaha-Sipila, A.: I. April 2000. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK](>aCommon/URI/RFC2396.pmnu6$package Regexp::Common::URI::RFC2396; use Regexp::Common qw /pattern clean no_defaults/; use strict; use warnings; our $VERSION = '2024080801'; use Exporter (); our @ISA = qw /Exporter/; my %vars; BEGIN { $vars {low} = [qw /$digit $upalpha $lowalpha $alpha $alphanum $hex $escaped $mark $unreserved $reserved $pchar $uric $urics $userinfo $userinfo_no_colon $uric_no_slash/]; $vars {parts} = [qw /$query $fragment $param $segment $path_segments $ftp_segments $rel_segment $abs_path $rel_path $path/]; $vars {connect} = [qw /$port $IPv4address $toplabel $domainlabel $hostname $host $hostport $server $reg_name $authority/]; $vars {URI} = [qw /$scheme $net_path $opaque_part $hier_part $relativeURI $absoluteURI $URI_reference/]; } our @EXPORT = (); our @EXPORT_OK = map {@$_} values %vars; our %EXPORT_TAGS = (%vars, ALL => [@EXPORT_OK]); # RFC 2396, base definitions. our $digit = '[0-9]'; our $upalpha = '[A-Z]'; our $lowalpha = '[a-z]'; our $alpha = '[a-zA-Z]'; # lowalpha | upalpha our $alphanum = '[a-zA-Z0-9]'; # alpha | digit our $hex = '[a-fA-F0-9]'; our $escaped = "(?:%$hex$hex)"; our $mark = "[\\-_.!~*'()]"; our $unreserved = "[a-zA-Z0-9\\-_.!~*'()]"; # alphanum | mark # %61-%7A, %41-%5A, %30-%39 # a - z A - Z 0 - 9 # %21, %27, %28, %29, %2A, %2D, %2E, %5F, %7E # ! ' ( ) * - . _ ~ our $reserved = "[;/?:@&=+\$,]"; our $pchar = "(?:[a-zA-Z0-9\\-_.!~*'():\@&=+\$,]|$escaped)"; # unreserved | escaped | [:@&=+$,] our $uric = "(?:[;/?:\@&=+\$,a-zA-Z0-9\\-_.!~*'()]|$escaped)"; # reserved | unreserved | escaped our $urics = "(?:(?:[;/?:\@&=+\$,a-zA-Z0-9\\-_.!~*'()]+|" . "$escaped)*)"; our $query = $urics; our $fragment = $urics; our $param = "(?:(?:[a-zA-Z0-9\\-_.!~*'():\@&=+\$,]+|$escaped)*)"; our $segment = "(?:$param(?:;$param)*)"; our $path_segments = "(?:$segment(?:/$segment)*)"; our $ftp_segments = "(?:$param(?:/$param)*)"; # NOT from RFC 2396. our $rel_segment = "(?:(?:[a-zA-Z0-9\\-_.!~*'();\@&=+\$,]*|$escaped)+)"; our $abs_path = "(?:/$path_segments)"; our $rel_path = "(?:$rel_segment(?:$abs_path)?)"; our $path = "(?:(?:$abs_path|$rel_path)?)"; our $port = "(?:$digit*)"; our $IPv4address = "(?:$digit+[.]$digit+[.]$digit+[.]$digit+)"; our $toplabel = "(?:$alpha"."[-a-zA-Z0-9]*$alphanum|$alpha)"; our $domainlabel = "(?:(?:$alphanum"."[-a-zA-Z0-9]*)?$alphanum)"; our $hostname = "(?:(?:$domainlabel\[.])*$toplabel\[.]?)"; our $host = "(?:$hostname|$IPv4address)"; our $hostport = "(?:$host(?::$port)?)"; our $userinfo = "(?:(?:[a-zA-Z0-9\\-_.!~*'();:&=+\$,]+|$escaped)*)"; our $userinfo_no_colon = "(?:(?:[a-zA-Z0-9\\-_.!~*'();&=+\$,]+|$escaped)*)"; our $server = "(?:(?:$userinfo\@)?$hostport)"; our $reg_name = "(?:(?:[a-zA-Z0-9\\-_.!~*'()\$,;:\@&=+]*|$escaped)+)"; our $authority = "(?:$server|$reg_name)"; our $scheme = "(?:$alpha"."[a-zA-Z0-9+\\-.]*)"; our $net_path = "(?://$authority$abs_path?)"; our $uric_no_slash = "(?:[a-zA-Z0-9\\-_.!~*'();?:\@&=+\$,]|$escaped)"; our $opaque_part = "(?:$uric_no_slash$urics)"; our $hier_part = "(?:(?:$net_path|$abs_path)(?:[?]$query)?)"; our $relativeURI = "(?:(?:$net_path|$abs_path|$rel_path)(?:[?]$query)?"; our $absoluteURI = "(?:$scheme:(?:$hier_part|$opaque_part))"; our $URI_reference = "(?:(?:$absoluteURI|$relativeURI)?(?:#$fragment)?)"; 1; __END__ =pod =head1 NAME Regexp::Common::URI::RFC2396 -- Definitions from RFC2396; =head1 SYNOPSIS use Regexp::Common::URI::RFC2396 qw /:ALL/; =head1 DESCRIPTION This package exports definitions from RFC2396. It's intended usage is for Regexp::Common::URI submodules only. Its interface might change without notice. =head1 REFERENCES =over 4 =item B<[RFC 2396]> Berners-Lee, Tim, Fielding, R., and Masinter, L.: I. August 1998. =back =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]Common/URI/RFC1035.pmnu6$package Regexp::Common::URI::RFC1035; use Regexp::Common qw /pattern clean no_defaults/; use strict; use warnings; our $VERSION = '2024080801'; use Exporter (); our @ISA = qw /Exporter/; my %vars; BEGIN { $vars {low} = [qw /$digit $letter $let_dig $let_dig_hyp $ldh_str/]; $vars {parts} = [qw /$label $subdomain/]; $vars {domain} = [qw /$domain/]; } our @EXPORT = qw /$host/; our @EXPORT_OK = map {@$_} values %vars; our %EXPORT_TAGS = (%vars, ALL => [@EXPORT_OK]); # RFC 1035. our $digit = "[0-9]"; our $letter = "[A-Za-z]"; our $let_dig = "[A-Za-z0-9]"; our $let_dig_hyp = "[-A-Za-z0-9]"; our $ldh_str = "(?:[-A-Za-z0-9]+)"; our $label = "(?:$letter(?:(?:$ldh_str){0,61}$let_dig)?)"; our $subdomain = "(?:$label(?:[.]$label)*)"; our $domain = "(?: |(?:$subdomain))"; 1; __END__ =pod =head1 NAME Regexp::Common::URI::RFC1035 -- Definitions from RFC1035; =head1 SYNOPSIS use Regexp::Common::URI::RFC1035 qw /:ALL/; =head1 DESCRIPTION This package exports definitions from RFC1035. It's intended usage is for Regexp::Common::URI submodules only. Its interface might change without notice. =head1 REFERENCES =over 4 =item B<[RFC 1035]> Mockapetris, P.: I. November 1987. =back =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]i^ ^ Common/URI/http.pmnu6$package Regexp::Common::URI::http; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC2396 qw /$host $port $path_segments $query/; use strict; use warnings; our $VERSION = '2024080801'; my $http_uri = "(?k:(?k:http)://(?k:$host)(?::(?k:$port))?" . "(?k:/(?k:(?k:$path_segments)(?:[?](?k:$query))?))?)"; my $https_uri = $http_uri; $https_uri =~ s/http/https?/; register_uri HTTP => $https_uri; pattern name => [qw (URI HTTP), "-scheme=http"], create => sub { my $scheme = $_ [1] -> {-scheme}; my $uri = $http_uri; $uri =~ s/http/$scheme/; $uri; } ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::http -- Returns a pattern for HTTP URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{HTTP}/ and print "Contains an HTTP URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{HTTP}{-scheme} Provides a regex for an HTTP URI as defined by RFC 2396 (generic syntax) and RFC 2616 (HTTP). If C<< -scheme => I

>> is specified the pattern I

is used as the scheme. By default I

is C. C and C are reasonable alternatives. The syntax for an HTTP URI is: "http:" "//" host [ ":" port ] [ "/" path [ "?" query ]] Under C<{-keep}>, the following are returned: =over 4 =item $1 The entire URI. =item $2 The scheme. =item $3 The host (name or address). =item $4 The port (if any). =item $5 The absolute path, including the query and leading slash. =item $6 The absolute path, including the query, without the leading slash. =item $7 The absolute path, without the query or leading slash. =item $8 The query, without the question mark. =back =head1 REFERENCES =over 4 =item B<[RFC 2396]> Berners-Lee, Tim, Fielding, R., and Masinter, L.: I. August 1998. =item B<[RFC 2616]> Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P. and Berners-Lee, Tim: I. June 1999. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]<;""Common/URI/file.pmnu6$package Regexp::Common::URI::file; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC1738 qw /$host $fpath/; use strict; use warnings; our $VERSION = '2024080801'; my $scheme = 'file'; my $uri = "(?k:(?k:$scheme)://(?k:(?k:(?:$host|localhost)?)" . "(?k:/(?k:$fpath))))"; register_uri $scheme => $uri; pattern name => [qw (URI file)], create => $uri, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::file -- Returns a pattern for file URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{file}/ and print "Contains a file URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{file} Returns a pattern that matches I URIs, as defined by RFC 1738. File URIs have the form: "file:" "//" [ host | "localhost" ] "/" fpath Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The scheme. =item $3 The part of the URI following "file://". =item $4 The hostname. =item $5 The path name, including the leading slash. =item $6 The path name, without the leading slash. =back =head1 REFERENCES =over 4 =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]O Common/URI/wais.pmnu6$package Regexp::Common::URI::wais; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC1738 qw /$host $port $search $database $wtype $wpath/; use strict; use warnings; our $VERSION = '2024080801'; my $scheme = 'wais'; my $uri = "(?k:(?k:$scheme)://(?k:$host)(?::(?k:$port))?/(?k:(?k:$database)" . "(?k:[?](?k:$search)|/(?k:$wtype)/(?k:$wpath))?))"; register_uri $scheme => $uri; pattern name => [qw (URI WAIS)], create => $uri, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::wais -- Returns a pattern for WAIS URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{WAIS}/ and print "Contains a WAIS URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{WAIS} Returns a pattern that matches I URIs, as defined by RFC 1738. WAIS URIs have the form: "wais:" "//" host [ ":" port ] "/" database [ ( "?" search ) | ( "/" wtype "/" wpath ) ] Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The I. =item $3 The I. =item $4 The I, if given. =item $5 The I, followed by I or I, if given. =item $6 The I. =item $7 The part following the I if given, including the question mark or slash. =item $8 The I part, if given. =item $9 The I, if given. =item $10 The I, if given. =back =head1 REFERENCES =over 4 =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]lk<Common/URI/tv.pmnu6$# TV URLs. # Internet draft: draft-zigmond-tv-url-03.txt package Regexp::Common::URI::tv; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC2396 qw /$hostname/; use strict; use warnings; our $VERSION = '2024080801'; my $tv_scheme = 'tv'; my $tv_url = "(?k:(?k:$tv_scheme):(?k:$hostname)?)"; register_uri $tv_scheme => $tv_url; pattern name => [qw (URI tv)], create => $tv_url, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::tv -- Returns a pattern for tv URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{tv}/ and print "Contains a tv URI.\n"; } =head1 DESCRIPTION =head2 C<$RE{URI}{tv}> Returns a pattern that recognizes TV uris as per an Internet draft [DRAFT-URI-TV]. Under C<{-keep}>, the following are returned: =over 4 =item $1 The entire URI. =item $2 The scheme. =item $3 The host. =back =head1 REFERENCES =over 4 =item B<[DRAFT-URI-TV]> Zigmond, D. and Vickers, M: I. December 2000. =item B<[RFC 2396]> Berners-Lee, Tim, Fielding, R., and Masinter, L.: I. August 1998. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]*JJCommon/URI/RFC1738.pmnu6$package Regexp::Common::URI::RFC1738; use Regexp::Common qw /pattern clean no_defaults/; use strict; use warnings; our $VERSION = '2024080801'; use Exporter (); our @ISA = qw /Exporter/; my %vars; BEGIN { $vars {low} = [qw /$digit $digits $hialpha $lowalpha $alpha $alphadigit $safe $extra $national $punctuation $unreserved $unreserved_range $reserved $uchar $uchars $xchar $xchars $hex $escape/]; $vars {connect} = [qw /$port $hostnumber $toplabel $domainlabel $hostname $host $hostport $user $password $login/]; $vars {parts} = [qw /$fsegment $fpath $group $article $grouppart $search $database $wtype $wpath $psegment $fieldname $fieldvalue $fieldspec $ppath/]; } our @EXPORT = qw /$host/; our @EXPORT_OK = map {@$_} values %vars; our %EXPORT_TAGS = (%vars, ALL => [@EXPORT_OK]); # RFC 1738, base definitions. # Lowlevel definitions. our $digit = '[0-9]'; our $digits = '[0-9]+'; our $hialpha = '[A-Z]'; our $lowalpha = '[a-z]'; our $alpha = '[a-zA-Z]'; # lowalpha | hialpha our $alphadigit = '[a-zA-Z0-9]'; # alpha | digit our $safe = '[-$_.+]'; our $extra = "[!*'(),]"; our $national = '[][{}|\\^~`]'; our $punctuation = '[<>#%"]'; our $unreserved_range = q [-a-zA-Z0-9$_.+!*'(),]; # alphadigit | safe | extra our $unreserved = "[$unreserved_range]"; our $reserved = '[;/?:@&=]'; our $hex = '[a-fA-F0-9]'; our $escape = "(?:%$hex$hex)"; our $uchar = "(?:$unreserved|$escape)"; our $uchars = "(?:(?:$unreserved|$escape)*)"; our $xchar = "(?:[$unreserved_range;/?:\@&=]|$escape)"; our $xchars = "(?:(?:[$unreserved_range;/?:\@&=]|$escape)*)"; # Connection related stuff. our $port = "(?:$digits)"; our $hostnumber = "(?:$digits\[.]$digits\[.]$digits\[.]$digits)"; our $toplabel = "(?:$alpha\[-a-zA-Z0-9]*$alphadigit|$alpha)"; our $domainlabel = "(?:(?:$alphadigit\[-a-zA-Z0-9]*)?$alphadigit)"; our $hostname = "(?:(?:$domainlabel\[.])*$toplabel)"; our $host = "(?:$hostname|$hostnumber)"; our $hostport = "(?:$host(?::$port)?)"; our $user = "(?:(?:[$unreserved_range;?&=]|$escape)*)"; our $password = "(?:(?:[$unreserved_range;?&=]|$escape)*)"; our $login = "(?:(?:$user(?::$password)?\@)?$hostport)"; # Parts (might require more if we add more URIs). # FTP/file our $fsegment = "(?:(?:[$unreserved_range:\@&=]|$escape)*)"; our $fpath = "(?:$fsegment(?:/$fsegment)*)"; # NNTP/news. our $group = "(?:$alpha\[-A-Za-z0-9.+_]*)"; our $article = "(?:(?:[$unreserved_range;/?:&=]|$escape)+" . '@' . "$host)"; our $grouppart = "(?:[*]|$article|$group)"; # It's important that # $article goes before # $group. # WAIS. our $search = "(?:(?:[$unreserved_range;:\@&=]|$escape)*)"; our $database = $uchars; our $wtype = $uchars; our $wpath = $uchars; # prospero our $psegment = "(?:(?:[$unreserved_range?:\@&=]|$escape)*)"; our $fieldname = "(?:(?:[$unreserved_range?:\@&]|$escape)*)"; our $fieldvalue = "(?:(?:[$unreserved_range?:\@&]|$escape)*)"; our $fieldspec = "(?:;$fieldname=$fieldvalue)"; our $ppath = "(?:$psegment(?:/$psegment)*)"; # # The various '(?:(?:[$unreserved_range ...]|$escape)*)' above need # some loop unrolling to speed up the match. # 1; __END__ =pod =head1 NAME Regexp::Common::URI::RFC1738 -- Definitions from RFC1738; =head1 SYNOPSIS use Regexp::Common::URI::RFC1738 qw /:ALL/; =head1 DESCRIPTION This package exports definitions from RFC1738. It's intended usage is for Regexp::Common::URI submodules only. Its interface might change without notice. =head1 REFERENCES =over 4 =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =back =head1 AUTHOR Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]\4Common/URI/gopher.pmnu6$package Regexp::Common::URI::gopher; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC1738 qw /$host $port $uchars/; use Regexp::Common::URI::RFC1808 qw /$pchars $pchar_range/; use strict; use warnings; our $VERSION = '2024080801'; my $pchars_notab = "(?:(?:[$pchar_range]+|" . "%(?:[1-9a-fA-F][0-9a-fA-F]|0[0-8a-fA-F]))*)"; my $gopherplus_string = $pchars; my $search = $pchars; my $search_notab = $pchars_notab; my $selector = $pchars; my $selector_notab = $pchars_notab; my $gopher_type = "(?:[0-9+IgT])"; my $scheme = "gopher"; my $uri = "(?k:(?k:$scheme)://(?k:$host)(?::(?k:$port))?" . "/(?k:(?k:$gopher_type)(?k:$selector)))"; my $uri_notab = "(?k:(?k:$scheme)://(?k:$host)(?::(?k:$port))?" . "/(?k:(?k:$gopher_type)(?k:$selector_notab)" . "(?:%09(?k:$search_notab)(?:%09(?k:$gopherplus_string))?)?))"; register_uri $scheme => $uri; pattern name => [qw (URI gopher -notab=)], create => sub { exists $_ [1] {-notab} && !defined $_ [1] {-notab} ? $uri_notab : $uri}, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::gopher -- Returns a pattern for gopher URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{gopher}/ and print "Contains a gopher URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{gopher}{-notab} Gopher URIs are poorly defined. Originally, RFC 1738 defined gopher URIs, but they were later redefined in an internet draft. One that was expired in June 1997. The internet draft for gopher URIs defines them as follows: "gopher:" "//" host [ ":" port ] "/" gopher-type selector [ "%09" search [ "%09" gopherplus_string ]] Unfortunally, a I is defined in such a way that characters may be escaped using the URI escape mechanism. This includes tabs, which escaped are C<%09>. Hence, the syntax cannot distinguish between a URI that has both a I and a I part, and an URI where the I includes an escaped tab. (The text of the draft forbids tabs to be present in the I though). C<$RE{URI}{gopher}> follows the defined syntax. To disallow escaped tabs in the I and I parts, use C<$RE{URI}{gopher}{-notab}>. There are other differences between the text and the given syntax. According to the text, selector strings cannot have tabs, linefeeds or carriage returns in them. The text also allows the entire I, (the part after the slash following the hostport) to be empty; if this is empty the slash may be omitted as well. However, this isn't reflected in the syntax. Under C<{-keep}>, the following are returned: =over 4 =item $1 The entire URI. =item $2 The scheme. =item $3 The host (name or address). =item $4 The port (if any). =item $5 The "gopher-path", the part after the / following the host and port. =item $6 The gopher-type. =item $7 The selector. (When no C<{-notab}> is used, this includes the search and gopherplus_string, including the separating escaped tabs). =item $8 The search, if given. (Only when C<{-notab}> is given). =item $9 The gopherplus_string, if given. (Only when C<{-notab}> is given). =back head1 REFERENCES =over 4 =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =item B<[RFC 1808]> Fielding, R.: I. June 1995. =item B<[GOPHER URL]> Krishnan, Murali R., Casey, James: "A Gopher URL Format". Expired Internet draft I. December 1996. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]iCommon/URI/RFC1808.pmnu6$package Regexp::Common::URI::RFC1808; BEGIN { # This makes sure 'use warnings' doesn't bomb out on 5.005_*; # warnings won't be enabled on those old versions though. if ($] < 5.006 && !exists $INC {"warnings.pm"}) { $INC {"warnings.pm"} = 1; no strict 'refs'; *{"warnings::unimport"} = sub {0}; } } use strict; use warnings; our $VERSION = '2024080801'; use Exporter (); our @ISA = qw /Exporter/; my %vars; BEGIN { $vars {low} = [qw /$punctuation $reserved_range $reserved $national $extra $safe $digit $digits $hialpha $lowalpha $alpha $alphadigit $hex $escape $unreserved_range $unreserved $uchar $uchars $pchar_range $pchar $pchars/], $vars {parts} = [qw /$fragment $query $param $params $segment $fsegment $path $net_loc $scheme $rel_path $abs_path $net_path $relativeURL $generic_RL $absoluteURL $URL/], } our @EXPORT = qw /$host/; our @EXPORT_OK = map {@$_} values %vars; our %EXPORT_TAGS = (%vars, ALL => [@EXPORT_OK]); # RFC 1808, base definitions. # Lowlevel definitions. our $punctuation = '[<>#%"]'; our $reserved_range = q [;/?:@&=]; our $reserved = "[$reserved_range]"; our $national = '[][{}|\\^~`]'; our $extra = "[!*'(),]"; our $safe = '[-$_.+]'; our $digit = '[0-9]'; our $digits = '[0-9]+'; our $hialpha = '[A-Z]'; our $lowalpha = '[a-z]'; our $alpha = '[a-zA-Z]'; # lowalpha | hialpha our $alphadigit = '[a-zA-Z0-9]'; # alpha | digit our $hex = '[a-fA-F0-9]'; our $escape = "(?:%$hex$hex)"; our $unreserved_range = q [-a-zA-Z0-9$_.+!*'(),]; # alphadigit | safe | extra our $unreserved = "[$unreserved_range]"; our $uchar = "(?:$unreserved|$escape)"; our $uchars = "(?:(?:$unreserved+|$escape)*)"; our $pchar_range = qq [$unreserved_range:\@&=]; our $pchar = "(?:[$pchar_range]|$escape)"; our $pchars = "(?:(?:[$pchar_range]+|$escape)*)"; # Parts our $fragment = "(?:(?:[$unreserved_range$reserved_range]+|" . "$escape)*)"; our $query = "(?:(?:[$unreserved_range$reserved_range]+|" . "$escape)*)"; our $param = "(?:(?:[$pchar_range/]+|$escape)*)"; our $params = "(?:$param(?:;$param)*)"; our $segment = "(?:(?:[$pchar_range]+|$escape)*)"; our $fsegment = "(?:(?:[$pchar_range]+|$escape)+)"; our $path = "(?:$fsegment(?:/$segment)*)"; our $net_loc = "(?:(?:[$pchar_range;?]+|$escape)*)"; our $scheme = "(?:(?:[-a-zA-Z0-9+.]+|$escape)+)"; our $rel_path = "(?:$path?(?:;$params)?(?:?$query)?)"; our $abs_path = "(?:/$rel_path)"; our $net_path = "(?://$net_loc$abs_path?)"; our $relativeURL = "(?:$net_path|$abs_path|$rel_path)"; our $generic_RL = "(?:$scheme:$relativeURL)"; our $absoluteURL = "(?:$generic_RL|" . "(?:$scheme:(?:[$unreserved_range$reserved_range]+|" . "$escape)*))"; our $URL = "(?:(?:$absoluteURL|$relativeURL)(?:#$fragment)?)"; 1; __END__ =pod =head1 NAME Regexp::Common::URI::RFC1808 -- Definitions from RFC1808; =head1 SYNOPSIS use Regexp::Common::URI::RFC1808 qw /:ALL/; =head1 DESCRIPTION This package exports definitions from RFC1808. It's intended usage is for Regexp::Common::URI submodules only. Its interface might change without notice. =head1 REFERENCES =over 4 =item B<[RFC 1808]> Fielding, R.: I. June 1995. =back =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]t:nnCommon/URI/prospero.pmnu6$package Regexp::Common::URI::prospero; use Regexp::Common qw /pattern clean no_defaults/; use Regexp::Common::URI qw /register_uri/; use Regexp::Common::URI::RFC1738 qw /$host $port $ppath $fieldname $fieldvalue $fieldspec/; use strict; use warnings; our $VERSION = '2024080801'; my $scheme = 'prospero'; my $uri = "(?k:(?k:$scheme)://(?k:$host)(?::(?k:$port))?" . "/(?k:$ppath)(?k:$fieldspec*))"; register_uri $scheme => $uri; pattern name => [qw (URI prospero)], create => $uri, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI::prospero -- Returns a pattern for prospero URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{prospero}/ and print "Contains a prospero URI.\n"; } =head1 DESCRIPTION =head2 $RE{URI}{prospero} Returns a pattern that matches I URIs, as defined by RFC 1738. prospero URIs have the form: "prospero:" "//" host [ ":" port ] "/" path [ fieldspec ] * Under C<{-keep}>, the following are returned: =over 4 =item $1 The complete URI. =item $2 The I. =item $3 The I. =item $4 The I, if given. =item $5 The propero path. =item $6 The field specifications, if given. There can be more field specifications; they will all be returned in C<$6>. =back =head1 REFERENCES =over 4 =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =back =head1 SEE ALSO L for other supported URIs. =head1 AUTHOR Abigail. (I). =head1 BUGS AND IRRITATIONS Bound to be plenty. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]gzCommon/whitespace.pmnu6$package Regexp::Common::whitespace; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; pattern name => [qw (ws crop)], create => '(?:^\s+|\s+$)', subs => sub {$_[1] =~ s/^\s+//; $_[1] =~ s/\s+$//;} ; 1; __END__ =pod =head1 NAME Regexp::Common::whitespace -- provides a regex for leading or trailing whitescape =head1 SYNOPSIS use Regexp::Common qw /whitespace/; while (<>) { s/$RE{ws}{crop}//g; # Delete surrounding whitespace } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. =head2 C<$RE{ws}{crop}> Returns a pattern that identifies leading or trailing whitespace. For example: $str =~ s/$RE{ws}{crop}//g; # Delete surrounding whitespace The call: $RE{ws}{crop}->subs($str); is optimized (but probably still slower than doing the s///g explicitly). This pattern does not capture under C<-keep>. =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]Mʆ Common/zip.pmnu6$package Regexp::Common::zip; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; # # Prefer '[0-9]' over \d, because the latter may include more # in Unicode string. # # # ISO and Cept codes. ISO code is the second column, Cept code is # the third. First column matches either. # # http://cept.org/ecc/topics/numbering-networks/numbering-related- # cooperation/the-cept-countries-joining-year-to-cept, # -cept-and-iso-country-codes,-e164-and-e212-country-codes # (http://bit.ly/1Ue268b) # my %code = ( Australia => [qw /AUS? AU AUS/], Austria => [qw /AU?T AT AUT/], Belgium => [qw /BE? BE B/], Denmark => [qw /DK DK DK/], France => [qw /FR? FR F/], Germany => [qw /DE? DE D/], Greenland => [qw /GL GL GL/], Italy => [qw /IT? IT I/], Liechtenstein => [qw /LIE? LI LIE/], Luxembourg => [qw /LU? LU L/], Monaco => [qw /MC MC MC/], Netherlands => [qw /NL NL NL/], Norway => [qw /NO? NO N/], 'San Marino' => [qw /SM SM SM/], Spain => [qw /ES? ES E/], Switzerland => [qw /CH CH CH/], USA => [qw /USA? US USA/], 'Vatican City' => [qw /VA VA VA/], ); # Returns the empty string if the argument is undefined, the argument otherwise. sub __ {defined $_ [0] ? $_ [0] : ""} # Used for allowable options. If the value starts with 'y', the option is # required ("{1,1}" is returned, if the value starts with 'n', the option # is disallowed ("{0,0}" is returned), otherwise, the option is allowed, # but not required ("{0,1}" is returned). sub _t { if (defined $_ [0]) { if ($_ [0] =~ /^y/i) {return "{1,1}"} if ($_ [0] =~ /^n/i) {return "{0,0}"} } "{0,1}" } # Returns the (sub)pattern for the country named '$name', and the # -country option '$country'. sub _c { my ($name, $country) = @_; if (defined $country && $country ne "") { if ($country eq 'iso') {return $code {$name} [1]} if ($country eq 'cept') {return $code {$name} [2]} return $country; } $code {$name} [0] } my %zip = ( # # Postal codes are four digits, but not all combinations are used. # # Valid codes from: # https://en.wikipedia.org/wiki/List_of_postal_codes_in_Austria # Austria => "(?k:1(?:[0-8][0-9][0-9]|90[01])" . "|2(?:[0-3][0-9][0-9]|" . "4(?:0[0-9]|1[0-3]|2[1-5]|3[1-9]|[4-6][0-9]|7[0-5]|" . "8[1-9]|9[0-9])|" . "[5-7][0-9][0-9]|" . "8(?:[0-7][0-9]|8[01]))" . "|3(?:0(?:0[1-9]|[1-9][0-9])|" . "[12][0-9][0-9]|" . "3(?:[0-2][0-9]|3[0-5]|[4-9][0-9])|" . "[4-8][0-9][0-9]|" . "9(?:[0-6][0-9]|7[0-3]))" . "|4(?:[01][0-9][0-9]|" . "2(?:[0-8][0-9]|9[0-4])|" . "3(?:0[0-3]|[1-8][0-9]|9[0-2])|" . "4(?:[0-1][0-9]|2[01]|3[1-9]|[4-9][0-9])|" . "[5-8][0-9][0-9]|" . "9(?:[0-7][0-9]|8[0-5]))" . "|5(?:0[0-9][0-9]|" . "1(?:0[0-9]|1[0-4]|[23][0-9]|4[0-5]|5[1-9]|[6-9][0-9])|" . "2(?:0[0-5]|1[1-9]|[2-7][0-9]|8[0-3])|" . "3(?:0[0-3]|1[01]|2[1-9]|[34][0-9]|5[01]|60)|" . "[4-6][0-9][0-9]|" . "7(?:[0-6][0-9]|7[01]))" . "|6(?:[0-5][0-9][0-9]|" . "6(?:[0-8][0-9]|9[01])|" . "[78][0-9][0-9]|" . "9(?:[0-8][0-9]|9[0-3]))" . "|7(?:[0-3][0-9][0-9]|" . "4(?:0[0-9]|1[0-3]|2[1-9]|[3-9][0-9])|" . "5(?:[0-6][0-9]|7[0-3]))" . "|8(?:[0-2][0-9][0-9]|" . "3(?:[0-5][0-9]|6[0-3]|8[0-5])|" . "4(?:0[1-9]|[1-9][0-9])|" . "[5-8][0-9][0-9]|" . "9(?:[0-8][0-9]|9[0-3]))" . "|9(?:[0-6][0-9][0-9]|" . "7(?:[0-7][0-9]|8[0-2])|" . "8(?:[0-6][0-9]|7[0-3])|" . "9(?:[0-8][0-9]|9[0-2]))" . ")", # # Postal codes of the form: 'DDDD', with the first digit representing # the province; the others distribution sectors. Postal codes do not # start with a zero. Not all combinations are in use. # # Data from http://download.geonames.org/export/zip/BE.zip # Belgium => "(?k:1(?:0(?:0[05-9]|1[0-2]|20|3[01]|4[013-57-9]|50|60|70|8[0-3]|90)|" . "1(?:0[05]|10|20|30|40|50|60|70|80|90)|" . "2(?:0[01]|1[02])|" . "3(?:0[01]|1[05]|2[05]|3[0-2]|4[0-28]|5[07]|6[07]|70|80|90)|" . "4(?:0[0-24]|1[04]|2[018]|3[05]|40|5[07]|6[01]|" . "7[0-46]|80|9[05])|" . "5(?:0[0-2]|4[017]|60|70)|" . "6(?:0[0-2]|20|30|40|5[0-4]|7[0134])|" . "7(?:0[0-3]|3[01]|4[0-25]|5[05]|6[01]|70|8[05]|90)|" . "8(?:0[04]|18|20|3[01]|40|5[0-3]|6[01]|80)|" . "9(?:10|3[0-4]|50|70|8[0-2]))" . "|2(?:0(?:00|18|20|30|40|50|60|70)|" . "1(?:00|10|40|50|60|70|80)|" . "2(?:00|2[0-3]|3[05]|4[023]|50|60|7[05]|8[08]|90)|" . "3(?:00|10|2[0-38]|30|40|50|60|70|8[0-27]|90)|" . "4(?:00|3[01]|40|50|60|70|80|9[01])|" . "5(?:00|20|3[01]|4[07]|50|60|70|80|90)|" . "6(?:00|10|2[07]|30|40|50|60)|" . "8(?:0[01]|1[12]|20|30|4[05]|50|6[01]|70|80|90)|" . "9(?:00|10|20|30|40|50|60|70|80|90))" . "|3(?:0(?:0[01]|1[028]|20|40|5[0-4]|6[01]|7[018]|80|90)|" . "1(?:1[018]|2[08]|30|40|50|9[01])|" . "2(?:0[0-2]|1[0-2]|2[01]|7[0-2]|9[034])|" . "3(?:00|2[01]|50|60|70|8[014]|9[01])|" . "4(?:0[014]|40|5[04]|6[01]|7[0-3])|" . "5(?:0[01]|1[0-2]|20|30|4[05]|50|60|70|8[0-3]|90)|" . "6(?:00|2[01]|3[01]|40|50|6[058]|70|80|90)|" . "7(?:00|17|2[0-4]|3[02]|4[026]|70|9[0-38])|" . "8(?:0[036]|3[0-2]|40|50|70|9[01])|" . "9(?:00|10|20|30|4[015]|50|60|7[01]|80|90))" . "|4(?:0(?:00|20|3[0-2]|4[0-2]|5[0-3]|90)|" . "1(?:0[0-2]|2[0-2]|30|4[01]|51|6[0-3]|7[01]|8[01]|90)|" . "2(?:1[07-9]|5[02-47]|6[013]|8[07])|" . "3(?:00|17|4[027]|5[017]|6[07])|" . "4(?:00|20|3[0-2]|5[0-38]|60|70|80)|" . "5(?:00|20|3[07]|40|5[07]|60|7[07]|90)|" . "6(?:0[0-26-8]|10|2[0134]|3[0-3]|5[0-4]|7[0-2]|8[0-4]|90)|" . "7(?:0[01]|1[01]|2[018]|3[01]|50|6[01]|7[01]|8[02-4]|9[01])|" . "8(?:0[0-2]|2[01]|3[0147]|4[015]|5[0-2]|6[01]|7[07]|80|90)|" . "9(?:00|10|20|50|60|70|8[037]|90))" . "|5(?:0(?:0[0-4]|2[0-24]|3[0-2]|60|70|8[01])|" . "1(?:0[01]|40|50|70|90)|" . "3(?:00|10|3[02-46]|40|5[0-4]|6[0-4]|7[02467]|80)|" . "5(?:0[0-4]|2[0-4]|3[07]|4[0-4]|5[05]|6[0-4]|7[0-6]|80|90)|" . "6(?:00|2[01]|30|4[0146]|5[01]|60|70|80))" . "|6(?:0(?:0[01]|10|20|3[0-2]|4[0-4]|6[01])|" . "1(?:1[01]|20|4[0-2]|50|8[0-3])|" . "2(?:00|1[01]|2[0-4]|3[08]|40|50|80)|" . "4(?:4[01]|6[0-4]|70)|" . "5(?:00|11|3[0-46]|4[023]|6[07]|9[0-46])|" . "6(?:00|3[07]|4[02]|6[0-36]|7[0-4]|8[016-8]|9[028])|" . "7(?:0[046]|17|2[0134]|30|4[0-37]|50|6[0-279]|8[0-2]|9[0-2])|" . "8(?:00|1[0-3]|2[0134]|3[0-468]|40|5[0-36]|60|70|8[07]|90)|" . "9(?:00|2[0-2479]|4[01]|5[0-3]|60|7[0-2]|8[02-467]|9[07]))" . "|7(?:0(?:00|1[0-2]|2[0-24]|3[0-4]|4[01]|50|6[0-3]|70|80|90)|" . "1(?:00|10|20|3[0134]|4[01]|60|70|8[01]|9[01])|" . "3(?:0[01]|2[0-2]|3[0-4]|40|50|70|8[027]|90)|" . "5(?:0[0-46]|2[0-2]|3[0-468]|4[0238])|" . "6(?:0[0-48]|1[018]|2[0-4]|4[0-3])|" . "7(?:00|1[12]|30|4[023]|50|60|8[0-4])|" . "8(?:0[0-4]|1[0-2]|2[23]|30|50|6[0-46]|70|80|90)|" . "9(?:0[01346]|1[0-2]|4[0-3]|5[01]|7[0-3]))" . "|8(?:0(?:00|20)|" . "2(?:00|1[01])|" . "3(?:0[01]|10|40|7[07]|80)|" . "4(?:00|2[01]|3[0-4]|50|60|70|80|90)|" . "5(?:0[01]|1[01]|20|3[01]|40|5[0-4]|60|7[023]|8[0-37])|" . "6(?:00|10|20|30|4[07]|50|60|70|80|9[01])|" . "7(?:00|10|20|30|40|5[05]|60|70|80|9[0-3])|" . "8(?:00|10|20|30|40|5[01]|60|70|80|90)|" . "9(?:0[02468]|20|30|40|5[0-46-8]|7[028]|80))" . "|9(?:0(?:00|3[0-2]|4[0-2]|5[0-2]|60|70|80|90)|" . "1(?:00|1[12]|20|30|40|50|60|70|8[05]|90)|" . "2(?:00|20|30|40|5[05]|60|70|80|90)|" . "3(?:0[08]|10|20|40)|" . "4(?:0[0-46]|20|5[01]|7[023])|" . "5(?:0[06]|2[01]|5[0-2]|7[0-2])|" . "6(?:00|20|3[06]|6[017]|8[018]|90)|" . "7(?:00|50|7[0-2]|90)|" . "8(?:00|10|20|3[01]|40|50|60|70|8[01]|90)|" . "9(?:00|10|2[01]|3[0-2]|40|50|6[018]|7[01]|8[0-28]|9[0-2]))" . ")", # # Postal codes of the form: 'DDDD', with the first digit representing # the distribution region, the second digit the distribution district. # Postal codes do not start with a zero. Postal codes starting with '39' # are in Greenland, and not included in the pattern. # Denmark => "(?k:0(?:800|" . "9(?:00|17|60|99))" . "|1(?:0(?:00|5[0-9]|6[0-9]|7[0-4]|9[2358])|" . "1(?:0[0-7]|1[0-9]|2[0-9]|3[01]|4[078]|5[0-9]|6[0-24-9]|" . "7[0-5])|" . "2(?:0[0-9]|1[013-9]|2[01]|40|5[013-79]|6[013-8]|7[01]|91)|" . "3(?:0[0-46-9]|1[0-9]|2[0-9]|5[02-9]|6[0-9]|7[01])|" . "4(?:0[0-36-9]|1[0-9]|2[0-9]|3[0-9]|4[018]|5[0-9]|" . "6[02-46-8]|7[0-2])|" . "5(?:00|13|3[23]|5[0-9]|6[0-46-9]|7[0-7]|9[29])|" . "6(?:0[0-46-9]|1[0-9]|2[0-4]|3[0-5]|5[0-9]|6[0-9]|7[0-7]|99)|" . "7(?:0[0-9]|1[0-24-9]|2[0-9]|3[0-9]|49|5[0-9]|6[0-6]|" . "7[0-57]|8[05-7]|9[09])|" . "8(?:0[0-9]|1[0-9]|2[02-9]|5[0-7]|6[0-8]|7[0-9])|" . "9(?:0[0-689]|1[0-7]|2[0-8]|5[0-9]|6[0-7]|7[0-4]))" . "|2(?:000|" . "1(?:00|50)|" . "200|" . "300|" . "4(?:00|50)|" . "500|" . "6(?:0[05]|10|2[05]|3[05]|40|50|6[05]|70|80|90)|" . "7(?:00|20|30|40|50|6[05]|70|91)|" . "8(?:00|20|30|40|50|60|70|80)|" . "9(?:00|20|30|42|50|60|70|80|90))" . "|3(?:0(?:00|50|60|70|80)|" . "1(?:00|20|40|50)|" . "2(?:00|10|20|30|50)|" . "3(?:00|10|20|30|60|70|90)|" . "4(?:00|50|60|80|90)|" . "5(?:00|20|40|50)|" . "6(?:00|30|50|60|70)|" . "7(?:00|20|30|40|51|60|70|82|90))" . "|4(?:0(?:00|30|40|50|60|70)|" . "1(?:00|30|40|60|7[134]|80|90)|" . "2(?:00|20|30|4[1-3]|50|6[12]|70|81|9[1356])|" . "3(?:00|20|30|40|50|60|70|90)|" . "4(?:00|20|40|50|60|70|80|90)|" . "5(?:00|20|3[24]|40|50|60|7[1-3]|8[13]|9[1-3])|" . "6(?:00|2[1-3]|32|40|5[2-4]|60|7[1-3]|8[1-4]|90)|" . "7(?:00|20|3[356]|50|60|7[1-3]|80|9[1-3])|" . "8(?:00|40|50|6[23]|7[1-4]|80|9[1245])|" . "9(?:00|1[23]|20|30|4[134]|5[1-3]|60|70|83|90))" . "|5(?:000|" . "2(?:00|10|20|30|40|50|60|70|90)|" . "3(?:00|20|30|50|70|80|90)|" . "4(?:00|50|6[2-46]|7[14]|85|9[12])|" . "5(?:00|40|50|60|80|9[12])|" . "6(?:00|10|20|31|42|72|83|90)|" . "7(?:00|50|62|7[12]|92)|" . "8(?:00|5[346]|63|7[14]|8[1-4]|92)|" . "9(?:00|3[25]|53|60|70|85))" . "|6(?:0(?:00|40|5[12]|64|70|9[1-4])|" . "100|" . "2(?:00|30|40|61|70|80)|" . "3(?:00|10|20|30|40|60|72|92)|" . "4(?:00|30|40|70)|" . "5(?:00|10|20|3[45]|41|60|80)|" . "6(?:00|2[1-3]|30|40|50|60|70|8[23]|90)|" . "7(?:0[05]|1[05]|20|31|40|5[23]|60|71|80|92)|" . "8(?:00|18|23|30|40|5[1-57]|62|70|80|93)|" . "9(?:00|20|33|40|50|60|7[13]|80|90))" . "|7(?:0(?:0[07]|80)|" . "1(?:00|20|30|40|50|60|7[13]|8[2-4]|90)|" . "2(?:00|50|60|70|80)|" . "3(?:00|2[13]|30|6[12])|" . "4(?:00|30|4[12]|51|70|80|90)|" . "5(?:00|40|50|60|70)|" . "6(?:00|20|50|60|73|80)|" . "7(?:00|30|4[12]|5[25]|60|70|90)|" . "8(?:00|30|40|50|60|70|84)|" . "9(?:00|50|60|70|80|90))" . "|8(?:000|" . "2(?:00|10|20|30|4[05]|50|60|70)|" . "3(?:0[05]|10|20|30|40|5[05]|6[12]|70|8[0-2])|" . "4(?:00|10|20|44|50|6[24]|7[12])|" . "5(?:00|20|30|4[134]|50|60|70|8[156]|92)|" . "6(?:00|20|32|4[13]|5[34]|60|70|80)|" . "7(?:00|2[1-3]|32|40|5[12]|6[2356]|8[13])|" . "8(?:00|3[0-2]|40|50|60|70|8[1-3])|" . "9(?:00|20|30|40|50|6[013]|70|8[13]|90))" . "|9(?:000|" . "2(?:00|10|20|30|40|60|70|80|93)|" . "3(?:00|10|20|30|40|52|62|70|8[0-2])|" . "4(?:00|30|40|60|80|9[023])|" . "5(?:00|10|20|30|41|50|60|7[45])|" . "6(?:00|10|20|3[12]|40|70|81|90)|" . "7(?:00|40|50|60)|" . "8(?:00|30|50|70|81)|" . "9(?:00|40|70|8[12]|90))" . ")", # # 5 Digit postal code, with leading 0s. # # Codes starting with 980 are reserved for Monaco, and not recognized # by the pattern. # # Data from: http://download.geonames.org/export/zip/FR.zip # France => "(?k:0(?:1(?:0(?:0[0-9]|1[0-9]|20|59|6[019]|90)|1(?:0[0-9]|" . "1[0-25-7]|2[0-9]|30|40|5[0-58]|60|7[0-4]|90)|" . "2(?:0[0-468]|1[0-367]|20|30|40|50|60|70|80|90)|" . "3(?:0[0-36]|10|20|30|40|50|6[0569]|70|80|90)|4(?:00|" . "10|20|30|4[0-3]|50|60|70|80)|5(?:0[0-68]|10|40|50|60|" . "70|80|90)|6(?:0[0-46]|3[02378]|40|60|80)|7(?:0[0-8]|" . "10|50)|8(?:00|51)|9(?:21|60|90))|" . "2(?:0(?:0[0-9]|1[0-9]|2[05])|1(?:0[0-9]|10|20|30|40|5[01]|" . "60|70|90)|2(?:0[0-9]|10|20|30|40|50|60|70|90)|" . "3(?:0[0-39]|1[045]|2[0-79]|3[01]|40|50|60|70|80|90)|" . "4(?:0[0-79]|10|20|30|40|50|60|70|80|90)|5(?:00|10|20|" . "40|50|70|80|90)|6(?:0[0-49]|10|20|30|40|50|70|80|90)|" . "7(?:00|20|60|90)|8(?:00|10|20|30|40|50|60|70|80)|" . "93[09])|" . "3(?:0(?:0[03-8]|1[0-9]|21)|1(?:0[0-9]|10|20|30|40|50|60|" . "70|90)|2(?:0[0-9]|10|20|30|40|50|60|70|90)|" . "3(?:0[0-79]|1[01459]|2[019]|30|40|50|60|70|80|90)|" . "4(?:0[0-3569]|10|20|30|40|5[02]|60|70)|5(?:00|10)|" . "6(?:00|30)|700|800)|" . "4(?:0(?:0[0-69]|1[0-9]|29)|1(?:0[0-7]|1[09]|20|30|40|50|" . "60|70|80|90)|2(?:0[0-39]|10|20|30|40|50|60|70|80|90)|" . "3(?:0[01]|10|20|30|40|50|60|70|80)|4(?:00|10|20)|" . "5(?:00|10|30)|6(?:00|60)|700|8(?:00|50|60|70)|99[05])|" . "5(?:0(?:0[0-8]|1[0-24-69])|1(?:0[0-57]|10|20|30|40|50|60|" . "70|90)|2(?:0[0-289]|20|30|40|50|60|90)|3(?:00|10|20|" . "30|40|50|80)|4(?:00|60|70|80)|5(?:00|60)|600|700|800)|" . "6(?:0(?:0[0-9]|1[0-36]|3[2-6]|4[4-9]|5[03]|7[1389]|8[2-5]|" . "99)|1(?:0[0-35-9]|1[03-79]|2[156]|3[0-35-79]|4[0-3]|" . "5[0-7]|6[0-247]|7[0-357]|8[0-79]|90)|2(?:0[0-69]|" . "1[0-2]|2[0-9]|3[0-9]|4[0-2]|5[0-579]|60|7[0-2]|" . "8[1-46-9]|9[02-59])|3(?:0[0-69]|10|20|30|4[0-589]|" . "5[2-47-9]|6[049]|7[0-369]|80|9[0-2])|4(?:0[0-8]|1[04]|" . "20|30|40|50|60|70|80)|5(?:0[0-8]|1[013-8]|20|3[0-245]|" . "40|50|60|70|80|90)|6(?:0[0-79]|10|20|3[1-4]|40|50|" . "6[06]|70|90)|7(?:0[0-689]|10|2[13]|30|40|50|90)|" . "8(?:0[0-68]|10|2[569]|3[013]|50|91)|9(?:0[1-69]|" . "1[02-5]|2[12589]|50|99))|" . "7(?:00[0-7]|1(?:0[0-9]|10|20|3[0-9]|40|50|60|70|90)|" . "2(?:0[0-9]|10|20|30|40|50|60|70|90)|3(?:0[0-9]|10|20|" . "30|40|50|60|70|80)|4(?:0[0-9]|10|30|40|50|60|70)|" . "5(?:0[0-9]|10|20|30|60|70|80|90)|6(?:00|10|30|60|90)|" . "7(?:00|90)|800)|" . "8(?:0(?:0[0-6]|1[0134]|9[089])|1(?:0[1-79]|10|20|30|40|50|" . "60|70|90)|2(?:0[0-9]|10|20|30|40|50|60|70|90)|" . "3(?:0[02-5]|10|20|30|50|60|70|80|90)|4(?:00|10|30|40|" . "50|60)|500|600|700|800)|" . "9(?:0(?:0[0-47-9]|1[4-7])|1(?:0[0-59]|10|20|30|40|60|90)|" . "2(?:0[019]|10|20|30|40|50|70|90)|3(?:0[01]|10|20|30|" . "40|50|90)|4(?:0[01]|20|60)|500|600|700|800))" . "|1(?:0(?:0(?:0[0-9]|1[0-58]|2[56]|3[0-2]|42|8[0189]|9[126])|" . "1(?:0[0-5]|10|2[0-28]|30|40|5[0-4]|60|70|80|90)|" . "2(?:0[0-28]|10|20|30|40|50|60|70|80|90)|3(?:00|10|20|" . "30|40|5[0-35]|60|7[01]|80|90)|4(?:0[0-4]|10|20|3[0-3]|" . "40|50)|5(?:00|10)|60[0-356]|700|800|9(?:0[12]|10))|" . "1(?:0(?:0[0-579]|1[0-25-7]|2[0-29])|1(?:0[0-9]|10|20|30|" . "40|50|60|70|90)|2(?:0[0-589]|10|20|30|40|50|60|70|90)|" . "3(?:0[0134]|10|20|30|40|50|60|70|80|90)|4(?:0[0-29]|" . "10|20|30|40|5[1-3]|80|9[0-4])|5(?:00|10|40|60|70|80|" . "90)|6(?:00|10|20)|7(?:00|8[12459]|90)|8(?:0[0235-8]|" . "1[06]|23|3[3568]|48|5[05]|60|7[05-8]|8[05]|9[08]))|" . "2(?:0(?:0[0-357-9]|19|2[0-9]|3[0-59]|40)|1(?:0[0-4689]|10|" . "20|30|40|50|60|70|90)|2(?:0[0-4]|10|20|30|40|50|60|70|" . "90)|3(?:00|10|20|30|40|50|60|70|80|90)|4(?:0[0-2]|10|" . "20|30|40|50|60|70|80|90)|5(?:00|10|20|40|50|60|80)|" . "6(?:00|20|30|40)|7(?:00|20|40|80)|8(?:00|50))|" . "3(?:0(?:0[0-9]|1[0-6]|20|6[67]|8[0589]|9[0-9])|1(?:0[0-9]|" . "1[0-9]|2[0-46-9]|3[0-389]|4[0-289]|5[0-35-9]|" . "6[013-589]|7[078]|8[0-2]|9[0-26])|2(?:0[0-3579]|" . "1[013-9]|2[0-8]|3[0-69]|4[0-589]|5[0-9]|6[0-9]|7[0-9]|" . "8[0-24-9]|9[0-9])|3(?:0[0-46-9]|1[0-9]|2[0-8]|" . "3[0-589]|4[02-8]|5[0-24-79]|6[0-46-9]|7[0-24-9]|" . "8[0-9]|9[0-79])|4(?:0[0-46]|1[0-7]|2[014-68]|3[0-245]|" . "4[0-8]|5[0-8]|6[02-47]|7[0-48]|8[0-49]|9[03])|" . "5(?:0[0-3]|1[0-4689]|2[0-589]|3[0-389]|4[0-35-9]|" . "5[0-289]|6[06-8]|7[02]|8[013]|9[0-49])|6(?:0[0-9]|" . "1[0-24-79]|2[015-9]|3[0-357]|4[0-369]|5[0-689]|6[0-9]|" . "7[0-8]|8[013-57-9]|9[0-9])|7(?:0[0-589]|1[02-9]|" . "2[0-9]|3[0-3]|4[0-79]|5[0-257-9]|6[046]|7[0-9]|" . "8[0-59]|9[0-9])|8(?:0[0-9]|1[02-5]|2[0-589]|3[0-689]|" . "4[0-24-7]|5[0-9]|6[0-478]|70|8[01379]|9[05])|" . "9(?:0[024-8]|1[01]|2[0-4]|3[0-37]|4[0-2]|50|60|80|90))|" . "4(?:0(?:0[05-9]|1[0-9]|2[03-9]|3[0-9]|4[05-8]|5[0-489]|" . "6[1-7]|7[04-9]|8[1-69]|9[0-9])|1(?:0[0-9]|1[0-47]|" . "2[0135-8]|30|40|50|6[0-258]|70|90)|2(?:0[0-57-9]|10|" . "20|30|40|50|60|70|80|90)|3(?:10|20|30|40|50|60|70|80|" . "90)|4(?:0[0-9]|10|20|30|40|50|6[0-29]|70|80|90)|" . "5(?:0[0-589]|10|20|30|40|50|70|90)|6(?:0[0-3]|10|20|" . "30|40|5[0-49]|70|80|90)|7(?:00|10|30|40|50|60|70|80|" . "9[01])|8(?:0[0-9]|10|30|40|50|60|80)|9(?:0[1-9]|" . "1[0-69]|2[0-6]|3[0-4]|4[09]|50|60|70|80|90))|" . "5(?:0(?:0[0-8]|1[0-57-9])|1(?:0[0-79]|10|20|30|40|50|60|" . "70|90)|2(?:00|10|2[09]|30|40|50|60|70|90)|3(?:00|10|" . "20|40|50|80)|4(?:00|30)|5(?:00|90)|600|700|800)|" . "6(?:0(?:0[0-8]|1[0-9]|2[0-6])|1(?:0[0-9]|1[0-3]|2[01]|30|" . "40|50|60|70|90)|2(?:00|10|20|30|40|50|60|70|90)|" . "3(?:00|10|20|30|40|50|60|70|80|90)|4(?:00|10|20|30|40|" . "50|60|70|80|90)|5(?:00|10|60|70|90)|6(?:00|20)|7(?:00|" . "10|20|30)|800|9(?:0[1-9]|1[0-9]|2[09]|5[0-59]|99))|" . "7(?:0(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-5]|5[1-6]|" . "7[1-689]|8[6-9])|1(?:0[0-9]|1[0-9]|2[013]|3[0236-9]|" . "40|50|60|70|8[0-9]|90)|2(?:0[0-9]|1[0145]|20|30|40|50|" . "60|70|8[1459]|90)|3(?:0[0-9]|1[0-4]|20|30|40|50|60|70|" . "80|90)|4(?:00|1[0-69]|20|30|4[0-69]|50|60|70|80|90)|" . "5(?:0[0-49]|10|20|30|40|50|60|70|80|90)|6(?:00|10|20|" . "30|40|50|70|90)|7(?:00|30|40|50|70|80)|8(?:00|10|40|" . "70|80|90)|9(?:20|40))|" . "8(?:0(?:0[0-7]|1[2-69]|2[0-9]|3[0-79])|1(?:0[0-9]|10|20|" . "30|40|50|60|70|90)|2(?:0[0-7]|10|20|30|40|50|60|70|" . "90)|3(?:00|10|20|30|40|50|60|70|80|90)|4(?:00|10)|" . "5(?:00|10|20|70)|600|700|800|9(?:1[01]|2[02-4]|3[459]|" . "4[015]|98))|" . "9(?:0(?:0[0-79]|1[1257-9]|33)|1(?:0[0-9]|1[01346-9]|20|30|" . "40|50|60|70|90)|2(?:0[0-489]|10|20|3[0-2]|40|50|60|70|" . "90)|3(?:00|1[0-9]|20|30|40|50|6[01]|70|80|90)|4(?:00|" . "10|30|50|60|70|90)|5(?:00|10|20|50|60)|600|700|800))" . "|2(?:0(?:0(?:00|90)|1(?:00|1[0-9]|2[1-9]|3[0-9]|4[0-8]|5[0-37]|" . "6[02-9]|7[0-9]|8[0-9]|9[0-57-9])|2(?:00|1[2-57-9]|" . "2[0-9]|3[0-9]|4[02-8]|5[0-369]|60|7[02569]|8[7-9]|" . "9[0-9])|3(?:0[2-69]|11)|4(?:0[1-35-9]|1[0-46-9])|" . "5(?:0[1-4]|3[78])|6(?:0[014]|11|20)|70[0-3]|900)|" . "1(?:0(?:0[0-9]|1[0-9]|2[1-9]|3[0-9]|4[0-9]|5[1-9]|" . "6[0-35-9]|7[0-9]|8[013-689]|9[2378])|1(?:10|2[01]|30|" . "40|50|60|70|90)|2(?:0[0-9]|1[09]|20|30|40|50|6[0-2]|" . "70|90)|3(?:0[0-59]|10|20|30|40|50|60|70|80|90)|" . "4(?:0[0-39]|10|20|30|40|50|60|70|90)|5(?:0[0-269]|10|" . "20|30|40|50|60|70|80|90)|6(?:0[0-49]|10|30|40|90)|" . "7(?:0[0-59]|19|60)|8(?:0[0-369]|20|50)|9(?:00|10|98))|" . "2(?:0(?:0[0-5]|1[4-7]|2[1-79]|3[1-5]|4[1-69]|7[09]|8[09]|" . "9[1-35689])|1(?:0[0-9]|1[01]|20|30|40|50|60|70|" . "9[0-69])|2(?:0[0-69]|10|20|30|40|50|60|70|90)|" . "3(?:0[0-9]|10|20|30|40|50|60|70|80|90)|4(?:0[02-59]|" . "10|20|30|40|50|60|70|80|90)|5(?:0[0-59]|10|20|30|40|" . "50|60|70|80|90)|6(?:0[02-79]|10|20|30|40|50|60|80|90)|" . "7(?:00|10|20|30|40|50|70|80)|8(?:00|10|20|30|60|70)|" . "9(?:30|40|50|60|70|80))|" . "3(?:0(?:0[0-9]|1[13-6]|20)|1(?:00|10|20|30|40|50|60|70|" . "90)|2(?:00|10|20|30|40|50|60|70|90)|3(?:00|20|40|50|" . "60|80)|4(?:00|20|30|50|60|80)|500|600|700|800)|" . "4(?:0(?:0[0-579]|1[0-79]|2[0249]|5[0-359]|60)|" . "1(?:0[0-24-9]|1[0-4]|2[0-2]|30|40|50|60|70|90)|" . "2(?:0[0-689]|1[02]|20|30|40|50|60|70|90)|3(?:00|10|20|" . "30|40|50|60|70|80|90)|4(?:00|10|20|30|40|50|60|70|80|" . "90)|5(?:00|10|20|30|40|50|60|70|80|90)|6(?:00|10|20|" . "30|40|50|60|80)|7(?:00|5[0-2589])|800|9(?:1[0235]|26))|" . "5(?:0(?:0[0-9]|1[0-9]|2[0-79]|3[0-9]|4[0-9]|5[0-246-9]|" . "6[0-389]|7[0-359]|8[02-79]|9[089])|1(?:1[0-9]|20|30|" . "40|50|60|70|90)|2(?:0[0-9]|1[0-9]|20|30|40|50|60|70|" . "90)|3(?:0[0-49]|10|20|30|40|50|60|70|80|90)|" . "4(?:0[0-69]|10|20|30|40|50|6[0-29]|7[09]|80|90)|" . "5(?:0[0-489]|10|20|30|50|60|70|80)|6(?:0[0-9]|10|20|" . "30|40|50|60|80|90)|7(?:0[0-26-9]|20|50|70|90)|8(?:00|" . "20|40|70)|9(?:09|20|3[0-3]|60))|" . "6(?:0(?:0[0-9]|1[0-5]|2[1-9]|3[0-2])|1(?:0[0-9]|1[019]|20|" . "3[01]|40|50|60|70|9[09])|2(?:0[0-9]|1[056]|20|30|" . "4[0-49]|50|60|70|90)|3(?:0[0-49]|10|20|30|40|50|80|" . "90)|4(?:0[0-29]|10|20|50|60|70)|5(?:0[0-49]|10|30|40|" . "60|70)|6(?:0[0-39]|20)|7(?:0[0-29]|30|40|50|6[01]|70|" . "80|90)|80[0-29]|9(?:0[1-79]|5[0-68]))|" . "7(?:0(?:0[0-9]|1[0235-9]|2[1-356]|3[0-9]|40|9[0-9])|" . "1(?:0[0-9]|10|2[0-27]|3[0-8]|40|50|60|70|80|90)|" . "2(?:0[0-9]|10|20|30|40|50|60|70|90)|3(?:0[0-9]|10|20|" . "30|40|50|60|70|80|90)|4(?:0[0-79]|10|20|30|40|50|60|" . "70|80|90)|5(?:0[0-9]|10|20|30|40|50|60|70|80|90)|" . "6(?:0[07]|10|20|30|40|50|60|70|80|90)|7(?:0[0-35]|10|" . "20|30|40|50|60|70|80|90)|8(?:00|10|20|30|50|60|70|90)|" . "9(?:09|1[014]|2[0489]|3[0-369]|4[09]|50))|" . "8(?:0(?:0[0-9]|1[189]|2[3-69]|3[3-9]|4[04]|8[08])|" . "1(?:0[0-689]|1[0-49]|20|3[0-3]|40|50|60|70|90)|" . "2(?:0[0-3579]|1[01]|20|3[0-24]|40|50|60|70|90)|" . "3(?:0[0-59]|10|20|30|40|50|60|80)|4(?:0[0-49]|10|" . "8[019])|50[01]|6(?:00|3[0-3679])|70[0-379]|800|9(?:01|" . "10|20|3[0-35]|44|50))|" . "9(?:0(?:00|18|80)|1(?:0[0-9]|2[0-59]|40|50|60|7[0-4679]|" . "8[0-79]|9[0-369])|2(?:0[06-9]|1[0-37-9]|2[0-57-9]|" . "3[138]|4[0-26]|5[0239]|60|70|8[029]|9[09])|3(?:00|10|" . "2[0-8]|3[0-7]|40|50|60|70|80|9[0-9])|4(?:0[0-4679]|" . "1[0-49]|20|30|40|5[05]|60|70|80|90)|5(?:00|10|20|30|" . "40|5[0-9]|6[013]|70|90)|6(?:0[0269]|10|20|30|40|50|60|" . "7[0-489]|8[0-2489]|90)|7(?:00|10|20|30|40|50|60|70|80|" . "90)|8(?:0[0-46-9]|10|2[0457]|3[03-79]|40|50|60|70|80|" . "90)|9(?:00|10|20|30|40|50|70|80|90)))" . "|3(?:0(?:0(?:0[0-36-9]|1[0-9]|2[0-589]|3[1-69]|4[04589]|" . "5[015])|1(?:0[0-79]|1[0-2459]|2[0-9]|3[0-49]|40|50|60|" . "70|90)|2(?:0[0-79]|10|20|30|40|5[0-35]|60|70|90)|" . "3(?:0[0-2]|1[01389]|20|30|40|50|60|80|90)|4(?:0[0-69]|" . "10|20|30|40|50|60|70|80|90)|5(?:00|10|20|30|40|60|70|" . "80)|6(?:00|10|20|30|40|50|60|70)|7(?:0[0-3]|20|30|40|" . "50|60|70)|8(?:00|20|40|70)|9(?:0[013-8]|1[0-48]|" . "2[0-59]|3[124-79]|4[0-37]|6[09]|7[125]|80))|" . "1(?:0(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-9]|" . "7[0-9]|8[0-24-689]|9[0-9])|1(?:0[0-4679]|1[02]|2[0-9]|" . "3[0-9]|4[0-29]|5[0-259]|60|70|8[09]|90)|2(?:0[013-5]|" . "10|20|30|4[0-59]|50|60|70|8[09]|90)|3(?:00|1[02-579]|" . "2[0-2569]|30|40|50|60|70|8[09]|90)|4(?:0[0-6]|10|20|" . "3[02]|40|50|60|70|8[09]|90)|5(?:0[03-7]|1[02]|" . "2[0-249]|30|40|50|60|70|8[09]|90)|6(?:0[0-689]|2[019]|" . "50|60|7[0-9]|8[1-359]|92)|7(?:0[0-9]|1[1256]|50|" . "7[0-4679]|80|90)|8(?:0[0-79]|10|20|3[0-29]|40|50|60|" . "70|80)|9(?:0[0-3]|31|4[57]|5[078]|6[02]|9[89]))|" . "2(?:0(?:0[0-57-9]|1[0-46-9]|2[0-2])|1(?:00|10|2[09]|30|40|" . "50|60|70|90)|2(?:0[019]|20|30|40|50|60|70|90)|3(?:00|" . "10|20|30|40|50|60|70|80|90)|4(?:00|10|20|30|40|50|60|" . "80|90)|5(?:0[0-259]|50)|600|7(?:00|20|30)|8(?:00|10))|" . "3(?:0(?:0[0-24-9]|1[0-259]|2[013-9]|3[0-8]|4[0-37-9]|" . "5[0-9]|6[0-9]|7[0-9]|8[0-9]|9[0-9])|1(?:00|1[02-6]|" . "2[013-7]|3[038]|4[018]|5[0-35]|6[04-79]|7[0-5]|" . "8[05-7]|9[0-3])|2(?:00|1[0-49]|20|30|40|50|60|" . "7[0-489]|9[0-5])|3(?:0[0569]|1[0-49]|2[0-4679]|3[05]|" . "4[01]|50|60|70|80|9[0-5])|4(?:0[0-59]|10|20|30|40|" . "5[0-2]|6[019]|70|80|9[0-25])|5(?:0[0-79]|1[05]|" . "2[0-79]|30|40|50|6[0-5]|70|80|90)|6(?:0[0-9]|1[0-5]|" . "2[015-79]|40|5[02]|60|70|8[089]|9[0-9])|7(?:0[0-9]|10|" . "20|3[0-9]|4[017]|50|60|70|80|90)|8(?:0[01]|10|20|30|" . "40|50|60|70|8[0-7]|90)|9(?:0[0-79]|1[0-589]|20|30|50|" . "70|80|9[08]))|" . "4(?:0(?:0[0-46-9]|1[0-2]|2[3-8]|3[02-57-9]|4[0-35689]|" . "5[13-68]|6[0-8]|7[0-9]|8[0235-79]|9[0-9])|1(?:1[0-9]|" . "20|3[0-27-9]|40|50|60|7[0-489]|8[13467]|9[0-9])|" . "2(?:0[0-479]|10|20|30|40|50|6[0-7]|7[04]|80|9[03-9])|" . "3(?:0[0-579]|10|20|30|40|50|60|70|80|9[0-46-9])|" . "4(?:0[0-49]|10|20|3[013-589]|40|50|60|7[037]|80|90)|" . "5(?:0[0-8]|1[03-8]|2[0-69]|3[04-79]|4[03-5]|50|6[04]|" . "70|90)|6(?:00|10|20|30|50|60|7[01]|80|90)|7(?:0[0-2]|" . "10|2[05]|30|4[0-27-9]|5[013]|60|70|90)|8(?:00|10|20|" . "30|50|7[1-5]|80)|9(?:00|2[0356]|3[2-57-9]|4[02-489]|" . "5[4-9]|6[0-2457]|7[02-57]|8[0-79]|90))|" . "5(?:0(?:0[0-9]|1[0-24-68]|2[0-46-9]|3[0-59]|4[02-79]|" . "5[0-57-9]|6[3-79]|7[013689]|8[0-9]|9[0-49])|" . "1(?:0[1-689]|1[134]|20|3[0-7]|40|50|6[0-469]|" . "7[0-24-7]|90)|2(?:0[0-57-9]|10|2[01]|3[056]|40|50|60|" . "70|90)|3(?:0[0-69]|10|20|30|4[0-259]|50|60|70|80|90)|" . "4(?:0[0-9]|1[0-9]|20|3[0-359]|40|50|60|70|80|90)|" . "5(?:0[0-79]|1[0-9]|2[01]|3[0-389]|40|50|60|7[1-46-9]|" . "80|90)|6(?:0[0-356]|10|20|30|40|5[0-39]|60|80|90)|" . "7(?:0[0-9]|11|20|30|4[0-46]|50|6[0-9]|7[0-2]|80)|" . "8(?:0[0-3]|3[0-3]|50|70|90)|9(?:0[0-9]|1[1-9]|2[01]|" . "60|98))|" . "6(?:0(?:0[0-9]|1[0-9]|2[0-9]|3[23])|1(?:0[0-579]|10|20|" . "3[01]|40|50|60|70|80|90)|2(?:00|10|20|30|40|5[05]|60|" . "70|90)|3(?:0[01]|10|20|30|40|50|60|70)|400|50[015]|" . "600|700|800|91[05])|" . "7(?:0(?:0[089]|1[0-9]|2[05-9]|3[2-589]|4[0-57-9]|5[89]|" . "6[01]|7[1-9]|8[0-29]|9[5-9])|1(?:00|10|20|30|40|5[02]|" . "60|7[0-59]|90)|2(?:0[04-69]|10|20|30|40|50|60|70|90)|" . "3(?:0[0-69]|10|2[01]|30|40|50|60|70|80|90)|" . "4(?:0[0-49]|20|60)|5(?:0[0-29]|10|2[01]|30|4[0-29]|" . "5[0-6])|60[0-29]|70[0-359]|800|9(?:1[0-357]|2[124-9]|" . "3[12]|4[12]))|" . "8(?:0(?:0[0-9]|1[0-9]|2[1-9]|3[0-79]|4[0-9]|5[0-4689]|" . "6[135-79]|7[047]|8[019]|9[0-36-9])|1(?:00|1[02-489]|" . "2[0-2]|3[048]|4[0246-8]|5[02-49]|6[0-59]|7[0-469]|80|" . "9[0167])|2(?:0[0-9]|1[016-9]|20|3[0-26]|4[0-469]|" . "5[06]|6[019]|70|80|9[0-35-79])|3(?:0[0-579]|1[1-579]|" . "2[0-2679]|3[0-4]|4[0-35-79]|5[0-46-9]|6[01]|70|80|90)|" . "4(?:0[0-9]|10|20|3[0-79]|40|50|60|70|80|90)|" . "5(?:0[0-9]|1[0169]|2[0-469]|30|40|5[0-79]|60|70|80|" . "9[01])|6(?:0[0-39]|10|20|30|40|50|60|70|80|90)|" . "7(?:0[0-26-9]|10|3[01]|40|50|6[01379]|70|8[0-249]|90)|" . "8(?:0[0-3]|1[67]|21|30|40|50|60|70|80|90)|9(?:00|13|" . "2[0167]|30|4[0134]|50|60|70|80))|" . "9(?:0(?:0[0-9]|1[056]|2[19]|3[0-9])|1(?:0[0-9]|10|20|30|" . "40|50|60|7[01]|8[019]|90)|2(?:0[0-9]|1[019]|20|30|40|" . "50|6[01]|70|90)|3(?:0[0-9]|10|20|30|50|60|70|80)|" . "4(?:0[0-9]|10|60)|5(?:0[0-2]|20|70)|60[0-359]|700|" . "80[0-9]))" . "|4(?:0(?:0(?:0[0-6]|1[1-35-9]|2[1-7]|90)|1(?:0[0-8]|1[058]|20|" . "30|4[01]|50|6[01]|70|80|90)|2(?:0[0-2]|10|20|3[0-259]|" . "40|50|60|70|8[0-26]|90)|3(?:0[0159]|10|20|30|50|60|70|" . "80|90)|4(?:00|10|20|30|40|6[05]|80)|5(?:0[0-2]|10|30|" . "50|60)|6(?:0[0-2]|30|60)|70[015]|80[015]|99[0-4])|" . "1(?:0(?:0[0-9]|1[0-35689]|2[0235689]|3[3-5]|4[23])|" . "1(?:0[0-3569]|10|2[0-2]|30|40|5[01]|60|70|90)|" . "2(?:0[0-7]|10|20|30|40|50|6[01]|70|90)|3(?:00|10|20|" . "30|5[03-57]|60|70)|40[0-26]|500|600|700|800|" . "9(?:0[13-689]|1[03-589]|2[145]|3[0-36]|4[1-3589]|" . "5[018]|6[03-8]|7[0-6]))|" . "2(?:0(?:0[0-9]|1[0-8]|2[1-9]|3[013]|4[1-357-9]|5[0589])|" . "1(?:00|1[014]|2[02-79]|3[01]|40|5[0235]|6[0-9]|" . "7[03469]|90)|2(?:10|20|30|40|60|7[0-35-79]|90)|" . "3(?:0[0-48]|1[0-58]|2[0-38]|3[02-59]|40|5[013-69]|60|" . "70|80|90)|4(?:0[0-9]|1[0-2]|20|30|40|50|60|70|8[0469]|" . "90)|5(?:0[0-359]|10|20|30|40|50|60|70|80|90)|" . "6(?:0[0-9]|10|20|30|40|5[013]|60|70|80)|7(?:0[0-579]|" . "20|40|50|80)|8(?:0[0-9]|10|20|30|40|90)|9(?:20|40|" . "5[0-589]|6[1-9]|90))|" . "3(?:0(?:0[0-689]|1[0-479])|1(?:0[0-3]|10|20|30|40|50|60|" . "70|90)|2(?:0[0-3]|10|20|30|40|50|60|70|90)|3(?:00|20|" . "30|40|50|60|70|80|90)|4(?:00|10|20|30|40|50|90)|" . "5(?:00|10|20|30|50|80|90)|6(?:00|20)|7(?:00|50|70)|" . "8(?:00|10))|" . "4(?:0(?:0[0-9]|1[0-9]|2[0-4]|3[2-68]|4[0-267]|9[02-579])|" . "1(?:0[0-79]|1[05-9]|2[0-469]|30|4[0-69]|5[0-9]|60|" . "7[069]|8[4-8]|9[0-689])|2(?:0[0-59]|1[0-79]|20|" . "3[0-69]|4[0-59]|50|6[0-358]|7[02-7]|90)|3(?:0[0-9]|" . "1[0-9]|2[0-9]|3[0-9]|4[0-69]|5[0-36-9]|60|7[0-39]|80|" . "90)|4(?:0[0-9]|1[02]|20|30|40|50|60|7[0-9]|8[0-4]|90)|" . "5(?:0[0-69]|10|2[0-2]|30|40|50|60|70|80|90)|" . "6(?:0[0-69]|1[0-8]|20|30|40|50|60|70|80|90)|" . "7(?:0[0-36-9]|10|20|30|40|50|60|70|80)|8(?:0[0-9]|" . "1[0-9]|2[1-49]|30|40|50|60|80)|9(?:00|1[1-9]|2[1-9]|" . "3[1-9]|4[124579]|5[1-9]|6[3-9]|7[1-8]|8[0-69]))|" . "5(?:0(?:0[0-9]|1[0-25-79]|2[13589]|3[0-58]|4[0-6]|" . "5[236-8]|6[0-57-9]|7[1-57-9]|8[1278])|1(?:00|10|" . "2[0-259]|30|4[0-79]|50|6[0-689]|70|90)|2(?:0[0-9]|" . "1[0-4]|20|30|40|50|60|70|90)|3(?:0[02-8]|1[02]|20|" . "3[01]|40|60|70|80|90)|4(?:0[0-469]|10|20|3[0-3]|50|60|" . "70|80|90)|5(?:0[0-4]|10|20|30|50|60|70|90)|6(?:00|20|" . "30|40|5[0156]|80)|7(?:0[0-29]|20|30|40|50|60|" . "7[01457])|8(?:0[0-9]|11)|9(?:00|1[0-35-9]|2[0-79]|" . "3[0-8]|4[3-9]|5[0-7]|6[0-9]|7[0-9]|80))|" . "6(?:0(?:0[0-589]|1[04-9]|2[0-3]|9[01])|1(?:0[0-36]|10|20|" . "30|40|50|60|70|90)|2(?:00|10|20|30|40|50|60|70)|" . "3(?:00|10|20|30|40|50|60)|400|500|600|700|800)|" . "7(?:0(?:0[02-8]|13|2[03]|3[0-29])|1(?:10|20|30|40|50|60|" . "70|80|90)|2(?:0[0-57-9]|1[013]|20|30|40|50|60|70|90)|" . "3(?:0[0-57-9]|10|20|30|40|50|60|70|80|90)|4(?:00|10|" . "20|30|40|50|70|80)|5(?:0[0-2]|10|20|5[0-359])|600|700|" . "800|9(?:0[19]|1[0-8]|2[0-59]|31))|" . "8(?:00[0-35-9]|1(?:00|10|20|30|40|50|60|70|90)|2(?:00|10|" . "20|30|40|50|60|70)|3(?:00|10|20|30|40|70)|400|500|600|" . "700|800)|" . "9(?:0(?:0[0-46-9]|1[014-8]|2[0-468]|3[2356]|4[13-79]|" . "5[1-359]|66|7[0-29]|80)|1(?:0[0-79]|1[0-25-79]|" . "2[02-5]|3[05-79]|40|50|60|70|8[0-4]|90)|2(?:20|30|" . "4[0-59]|50|60|70|80|90)|3(?:0[0-9]|1[0-249]|2[0157-9]|" . "30|40|50|60|70|80|90)|4(?:0[0-689]|1[0-578]|2[015-8]|" . "30|40|5[068]|60|8[0146]|90)|5(?:0[0-59]|10|20|30|40|" . "60|70|90)|6(?:0[0-29]|10|20|30|40|50|60|70|80|90)|" . "7(?:00|10|30|40|50|70)|80[0-59]|9(?:0[56]|1[1-39]|" . "2[57]|3[347-9]|4[19])))" . "|5(?:0(?:0(?:0[0-9]|1[0-6]|50)|1(?:0[0-9]|1[03-5]|20|3[01]|40|" . "50|60|70|80|90)|2(?:0[0-9]|1[01]|20|30|40|50|60|70|" . "90)|3(?:0[0-9]|10|20|30|40|50|60|70|80|90)|" . "4(?:0[0-79]|10|20|30|4[0-24-9]|50|60|70|80|90)|5(?:00|" . "10|20|30|40|50|60|70|80|90)|6(?:00|10|20|30|40|5[12]|" . "60|70|80|90)|7(?:00|10|20|30|40|50|60|70)|8(?:00|10|" . "40|50|60|70|80|90)|95[018])|" . "1(?:0(?:0[015-9]|1[0-367]|2[12]|3[5-9]|4[1-3]|5[1-9]|" . "6[0-9]|7[0-79]|8[0-46-9]|9[025-79])|1(?:00|10|2[0-2]|" . "30|40|50|60|70|90)|2(?:0[0-9]|10|20|30|40|50|60|70|" . "90)|3(?:0[0-689]|1[089]|20|3[0-4]|4[09]|50|6[01]|70|" . "80|90)|4(?:0[01]|20|3[0-5]|50|60|70|80|90)|5(?:00|10|" . "20|30|7[1-3])|6(?:0[01]|6[2-4]|7[357-9]|8[2-9])|" . "7(?:00|1[35]|2[1-36])|8(?:0[01]|7[13]|8[46])|90[024])|" . "2(?:0(?:0[0-8]|1[1246])|1(?:0[0-9]|1[0-35]|20|30|40|50|60|" . "70|90)|2(?:0[0-9]|10|20|30|40|50|60|70|90)|3(?:0[01]|" . "10|20|30|40|60|70)|4(?:00|10)|50[0-2]|600|700|800|" . "9(?:0[1-6]|1[579]|20))|" . "3(?:0(?:0[0-9]|1[02-69]|2[0-2]|3[0-2]|6[0-39]|73|8[0-9]|" . "9[013-589])|1(?:0[0-59]|10|20|40|50|60|70|90)|" . "2(?:0[0-5]|10|20|30|40|50|60|70|90)|3(?:00|20|40|50|" . "60|70|80|90)|4(?:00|10|20|40|70|80)|5(?:00|40)|" . "6(?:0[0-2]|40)|700|8(?:00|1[01])|9(?:4[0-2]|5[01]|60|" . "7[01]))|" . "4(?:0(?:0[0-9]|1[0-7]|2[0-39]|3[125-9]|4[1-35-9]|5[2-46]|" . "6[2-4]|7[1-46]|82|9[6-8])|1(?:00|1[0-689]|2[0-39]|" . "3[0-689]|40|5[0-49]|60|70|8[0-69]|90)|2(?:0[0-69]|" . "1[01]|20|30|40|50|6[0-3]|7[0-39]|80|90)|3(?:0[0-59]|" . "1[0-29]|20|30|40|50|60|70|8[05]|90)|4(?:0[0-69]|" . "1[0-4]|2[05]|30|40|50|60|70|80|90)|5(?:0[0-79]|" . "1[0-79]|2[0-9]|30|40|50|60|70|80|90)|6(?:0[0-389]|10|" . "20|30|40|50|60|70|80|90)|7(?:0[0-689]|1[0-69]|20|30|" . "40|50|60|70|80|90)|8(?:0[0-3]|10|20|30|40|50|60|70|80|" . "90)|9(?:00|10|20|3[01349]|4[01]|50|60|70|80|90))|" . "5(?:0(?:0[0-35-8]|1[2-5]|2[01])|1(?:0[0-9]|1[0239]|20|30|" . "40|50|60|70|90)|2(?:0[0-35]|10|2[01]|30|40|50|60|" . "7[01]|90)|3(?:00|10|20)|4(?:00|30)|500|600|700|8(?:00|" . "40))|" . "6(?:0(?:0[0-9]|1[06-9]|2[09]|3[46-9])|1(?:0[0-9]|10|20|30|" . "40|50|60|7[0-589]|90)|2(?:0[01479]|19|20|3[019]|40|50|" . "60|7[0-79]|90)|3(?:0[0-9]|1[0-279]|2[0-9]|30|4[0-39]|" . "50|60|70|8[0-3]|90)|4(?:0[0-79]|1[0139]|20|30|40|50|" . "60|70|80|90)|5(?:0[0-469]|10|20|3[0-2569]|40|50|60|70|" . "80|90)|6(?:0[0-379]|10|20|30|40|50|60|70|80|90)|" . "7(?:0[0-59]|30|40|50|60|70|80)|8(?:0[0-59]|40|5[045]|" . "60|70|80|9[0-369])|9(?:0[0-39]|10|20|30|5[014679]|" . "7[0379]|98))|" . "7(?:0(?:0[03-9]|1[0-9]|2[0138]|3[0-8]|4[014-69]|5[0-4679]|" . "6[1-3]|7[0-9]|8[1-4])|1(?:0[0-689]|19|2[05-9]|3[0-3]|" . "4[0146-9]|5[0-579]|6[0-49]|7[05]|8[015]|9[0-39])|" . "2(?:0[0-9]|1[124-9]|20|3[0-4]|4[05]|5[05]|60|70|" . "8[0-39]|9[0-29])|3(?:0[0-49]|10|20|30|40|5[0-249]|" . "6[0-359]|7[0-39]|8[0-35]|90)|4(?:0[0-59]|1[025]|20|30|" . "4[05]|5[05]|60|70|80|90)|5(?:0[0-9]|1[05]|2[05]|3[05]|" . "40|50|6[05]|70|80|90)|6(?:0[0-9]|1[09]|20|3[05]|4[05]|" . "5[05]|60|70|8[05]|90)|7(?:0[0-59]|10|20|3[019]|4[078]|" . "5[167]|7[02478]|80|90)|8(?:0[013-59]|1[05]|20|30|40|" . "5[05]|6[05]|70|80|90)|9(?:05|1[0-3569]|2[05]|3[05]|40|" . "5[0-57-9]|60|7[0-489]|80|90))|" . "8(?:0(?:0[0-9]|1[3-9]|2[02-9]|3[3469])|1(?:10|20|30|40|50|" . "60|70|80|90)|2(?:0[0-9]|10|20|30|40|50|60|70|90)|" . "3(?:0[0-2]|10|20|30|40|50|60|70|80|90)|4(?:0[0-5]|10|" . "20|30|40|50|60|70|90)|5(?:0[0-38]|30)|6(?:00|4[0-39]|" . "60)|700|800)|" . "9(?:0(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[1-9]|" . "6[0-3569]|7[0-489]|8[0-46-8]|9[127])|1(?:0[08]|1[0-9]|" . "2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-9]|7[0-9]|8[0-24-9]|" . "9[0-589])|2(?:0[0237-9]|1[0-9]|2[0-79]|3[0-9]|4[0-79]|" . "5[0-589]|6[0-9]|7[0-57-9]|8[0-8]|9[02-79])|3(?:0[0-9]|" . "1[0-9]|2[0-2689]|3[0-9]|4[1569]|5[0189]|6[0-5]|" . "7[03-9]|8[0-3569]|9[0-39])|4(?:0[0-9]|1[0-369]|" . "2[0-24-9]|3[0-35-7]|4[0-9]|5[0-35-8]|6[0-8]|7[0-689]|" . "8[0-35-7]|9[0-7])|5(?:0[0-9]|10|2[02-49]|3[0-25-7]|" . "4[0-4]|5[0-57-9]|6[0-47-9]|7[0-3]|8[0-46-9]|90)|" . "6(?:0[0-8]|1[0-38]|20|3[0579]|40|5[0-9]|6[0-79]|" . "7[0-37]|8[0-35-79]|90)|7(?:0[0-9]|1[0-9]|2[0-367]|" . "3[0-5]|40|50|60|7[079]|8[0-57-9]|9[0-2])|8(?:00|" . "1[0-8]|20|3[0-289]|4[057-9]|5[0-39]|6[0-9]|7[0-8]|" . "8[0-579]|9[0-9])|9(?:00|10|20|3[0-3]|4[0-48]|5[0-2]|" . "6[0-57]|7[0-2569]|8[014]|9[08])))" . "|6(?:0(?:0(?:0[024-9]|1[0-9]|2[1-9]|3[15])|1(?:0[0-9]|1[0-9]|" . "2[0-36-9]|3[0-248]|4[019]|5[0357]|6[02]|7[035]|" . "8[013-5]|90)|2(?:0[0-9]|10|20|30|40|5[0-2]|60|7[01]|" . "8[01]|9[0-39])|3(?:0[0-9]|1[0-9]|2[0139]|3[02]|40|50|" . "60|70|80|90)|4(?:0[0-369]|10|20|3[0-7]|40|51|60|7[67]|" . "80|90)|5(?:0[0134689]|10|20|30|4[0-4]|5[0-2]|60|70|80|" . "90)|6(?:0[0237-9]|1[0-27-9]|20|3[1-57-9]|4[036-9]|50|" . "60|7[1247]|80|90)|7(?:00|1[01]|2[1-39]|3[0-24]|" . "4[0-59]|5[01]|6[125]|7[12679]|90)|8(?:0[0-5]|10|20|" . "3[1-3]|40|50|60|7[0-2]|80|90)|9(?:0[2389]|1[12]|" . "2[1-4]|3[0-2]|40|50|60|81))|" . "1(?:0(?:0[0-9]|1[1-9]|2[1-4]|4[12]|51)|1(?:0[0-79]|10|20|" . "30|40|50|60|70|90)|2(?:0[0-689]|10|20|30|40|50|60|70|" . "90)|3(?:0[0-6]|10|20|30|40|50|60|70|80|90)|4(?:00|10|" . "20|3[08]|4[08]|5[08]|70|90)|5(?:00|50|60|70)|600|" . "7(?:00|90)|8(?:00|91)|9(?:61|84|9[24]))|" . "2(?:0(?:0[0-57-9]|1[0-9]|2[0-9]|3[0-46]|5[1-59]|6[0-79]|" . "7[0-29]|8[019]|9[0-2])|1(?:0[0-9]|1[0-46-9]|2[0-46-9]|" . "3[0-246-9]|4[0-579]|5[0-35-9]|6[0-24-69]|7[023569]|" . "8[02579]|9[0-469])|2(?:0[0-79]|1[0-357-9]|2[0-68]|" . "3[0-2]|4[025-9]|5[0-9]|60|70|80|90)|3(?:0[0-9]|1[01]|" . "2[0-257]|3[0-6]|40|50|6[01]|70|80|90)|4(?:0[0-8]|" . "1[0-289]|20|30|40|5[0-39]|60|70|80|90)|5(?:0[0-9]|10|" . "20|30|40|50|60|7[05]|80|90)|6(?:0[0-4689]|10|20|30|40|" . "50|60|70|80|90)|7(?:0[0-29]|10|20|30|40|50|60|70|80|" . "90)|8(?:0[0-69]|10|20|30|40|50|60|70|8[0-29]|90)|" . "9(?:0[1-9]|10|2[0-39]|30|40|5[0-5]|6[05-9]|7[0-8]|80|" . "90))|" . "3(?:0(?:0[0-9]|1[0-9]|2[0-489]|3[0-9]|4[02-69]|5[014-8]|" . "6[34])|1(?:00|1[0-9]|2[02]|30|40|50|60|7[0-578]|90)|" . "2(?:0[0-6]|10|20|30|40|50|60|70|90)|3(?:0[0-8]|10|20|" . "30|40|50|60|70|80|90)|4(?:0[0-9]|10|20|30|40|50|60|70|" . "80|90)|5(?:0[0-6]|10|20|30|40|50|60|70|80|90)|6(?:00|" . "10|20|30|40|50|60|70|80|90)|7(?:00|10|20|30|40|50|60|" . "70|80|90)|8(?:0[0-48]|10|20|30|40|50|70|80|90)|9(?:00|" . "10|20|30|40|5[09]|6[0-9]|7[02]|80|90))|" . "4(?:0(?:0[0-46-8]|1[0-35-9]|2[0-47-9]|3[0-9]|4[0-46]|" . "5[0-9]|6[0-24]|7[1589]|8[0-2679]|90)|1(?:0[0-9]|" . "1[0-356]|2[0-2]|30|4[0-35-8]|50|60|70|8[1-57]|90)|" . "2(?:0[0-68]|10|20|3[0-8]|40|50|60|70|90)|3(?:0[0-47]|" . "10|20|30|40|50|60|70|90)|4(?:0[0-4]|10|20|30|40|50|60|" . "70|80|90)|5(?:0[0-6]|1[01]|20|30|60|70)|6(?:0[0-5]|40|" . "60|80)|7(?:0[0-5]|80)|8(?:00|11|70)|990)|" . "5(?:0(?:0[0-9]|1[03-8]|2[0-5])|1(?:0[0-8]|1[0-267]|20|30|" . "40|50|7[01]|90)|2(?:0[0-4]|20|30|40|50|60|70|90)|" . "3(?:0[0-37-9]|1[0-2]|2[01]|30|50|60|70|80|90)|" . "4(?:0[0-2]|10|2[019]|30|40|60|90)|5(?:0[0-3]|10|60|" . "90)|6(?:0[01]|60|70|90)|7(?:0[016]|10)|80[01]|" . "9(?:0[1-57]|1[124578]|2[01]|30|5[01]))|" . "6(?:0(?:0[0-6]|1[1-57-9]|2[015-9]|3[0-49]|46|50|70)|" . "1(?:0[0-3]|1[0-3]|2[0-3]|30|4[0145]|50|6[0-25]|70|80|" . "90)|2(?:0[0-2]|10|20|30|40|50|60|70|80|90)|3(?:0[0-2]|" . "10|20|3[01459]|40|50|60|70|80|90)|4(?:0[0-3]|10|" . "2[0-3]|30|40|50|60|70|80|90)|5(?:0[0-29]|10|30|40|50|" . "60|70)|6(?:0[0-24-69]|10|20|5[0-29]|6[04]|70|80|90)|" . "7(?:0[0-4]|20|30|40|5[015]|60)|8(?:00|20|3[0-26]|45|" . "5[0346]|6[036]|70)|9(?:06|21|3[13]|4[015]|5[019]|" . "6[0-8]|87))|" . "7(?:0(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[3-6]|59|6[01457-9]|" . "7[013-7]|8[0-9]|9[0-3689])|1(?:0[029]|1[02-8]|2[0-69]|" . "3[0-378]|4[0-6]|5[0-258]|6[0-35-79]|7[0-3]|90)|" . "2(?:0[0-79]|1[0-9]|20|3[0-2459]|4[0-39]|50|6[0-29]|70|" . "80|90)|3(?:0[0-8]|1[0-289]|20|30|40|50|60|70|8[0-2]|" . "90)|4(?:0[0-57-9]|1[0-2]|20|30|4[01]|5[0-9]|60|70|80|" . "90)|5(?:0[0-79]|10|2[01]|30|4[0-2]|50|60|70|80|90)|" . "6(?:0[0-9]|10|20|30|40|50|60|70|80|90)|7(?:0[0-9]|10|" . "2[0-8]|30|50|60|70|90)|8(?:0[0-479]|10|20|3[1-4689]|" . "4[0-3]|50|60|70|80|9[12])|9(?:0[05-79]|1[13]|" . "2[0-35-8]|3[0-3]|4[2-489]|5[2357-9]|6[0-79]|7[024-9]|" . "8[0-6]|9[09]))|" . "8(?:0(?:0[0-9]|1[02-9]|2[0-79]|40|5[0-9]|6[0-9]|7[0-467]|" . "8[2-6]|9[0-379])|1(?:00|1[068]|2[014-8]|3[0-49]|40|" . "5[0-39]|60|7[0-3]|80|90)|2(?:00|10|2[01]|30|40|50|" . "6[0-5]|7[0-4]|80|90)|3(?:0[0-9]|1[0-7]|20|3[0-3]|40|" . "50|60|70|80|9[0-39])|4(?:00|10|20|40|60|70|80|90)|" . "5(?:0[0-49]|10|20|30|40|50|60|70|80|90)|6(?:00|10|20|" . "30|40|50|60|80|90)|7(?:0[0-5]|20|30|40|50|60|70|80|" . "90)|8(?:0[0-2469]|20|30|40|50|70|90)|9(?:10|2[013579]|" . "4[13-57-9]|50|6[08]|70|80|90))|" . "9(?:0(?:0[1-9]|6[124])|1(?:00|1[05]|2[04-69]|3[0-2469]|" . "4[0-578]|5[0-49]|6[01]|7[0-3]|9[0-259])|2(?:0[0-9]|" . "1[0-9]|2[05-9]|3[0279]|4[0-7]|5[0-35-9]|6[0-9]|" . "7[0-2569]|8[0-9]|9[0-4])|3(?:0[0-379]|1[0679]|" . "2[0-26-9]|3[06-9]|4[0-9]|5[0-9]|6[0-79]|7[0-3679]|" . "8[0459]|9[0-9])|4(?:0[0-689]|1[0-9]|2[0-9]|3[0-9]|" . "4[0-9]|5[0-9]|6[013-9]|7[024-9]|8[0-9]|9[0-35])|" . "5(?:0[0-359]|1[0-9]|20|3[01]|4[0-4]|5[0-3]|6[013-59]|" . "7[0-4689]|8[0-3]|9[0-5])|6(?:0[0-9]|1[0-3569]|2[0-9]|" . "3[0-9]|4[0-9]|5[0-9]|6[014579]|7[0-79]|8[024-79]|" . "9[0-46])|7(?:0[0-29]|14|2[0679]|3[0-25]|4[0-79]|5[15]|" . "60|7[01]|80|9[0-5])|8(?:0[0-689]|1[1-4679]|2[02-49]|" . "3[0-36]|4[01]|50|60|70|8[1-39]|9[01])|9(?:0[0-8]|10|" . "2[1-6]|3[0-9]|4[25-9]|5[1-57]|6[0-489]|70|98)))" . "|7(?:0(?:0(?:0[0-7]|1[349]|2[0-2]|30)|1(?:0[0-4]|10|20|30|40|" . "50|60|70|80|90)|2(?:0[0-4]|10|20|30|40|50|70|80|90)|" . "3(?:0[0-46]|10|20|60)|4(?:00|40)|500|600|700|80[07])|" . "1(?:0(?:0[0-9]|1[0-27-9]|2[0-9]|31|4[09])|1(?:0[0-9]|" . "1[08]|20|30|40|50|60|70|90)|2(?:0[0-69]|10|20|30|40|" . "50|60|70|90)|3(?:0[0-9]|10|2[0-8]|3[0-79]|40|50|60|70|" . "80|90)|4(?:0[0-57-9]|10|20|30|40|50|60|70|80|90)|" . "5(?:0[0-39]|10|20|30|40|50|70|80|90)|6(?:0[0-49]|20|" . "40|70|80)|7(?:00|10|40|60)|8(?:00|50|70|80)|9(?:60|" . "90))|" . "2(?:0(?:0[0-9]|1[013-689]|2[14-9]|3[02-9]|4[0-57-9]|" . "5[12589]|7[0-359]|8[0-9]|9[1-356])|1(?:0[09]|10|20|30|" . "40|50|60|70|90)|2(?:0[0-3568]|10|20|3[0-4679]|40|50|" . "60|70|90)|3(?:0[0-589]|10|20|30|40|50|60|70|80|90)|" . "4(?:0[0-79]|30|40|50|60|70)|5(?:00|10|30|40|50|60)|" . "6(?:00|10|50)|70[02-5]|800|90[28])|" . "3(?:0(?:0[0-9]|1[014-9]|2[0-24-6]|31|65|7[39]|89|9[14])|" . "1(?:0[0-9]|10|2[0-479]|30|40|5[0-579]|60|70|9[0-39])|" . "2(?:0[0-9]|1[0-2469]|2[013-59]|3[0-259]|40|50|" . "6[01459]|7[067]|9[0-2459])|3(?:0[0-39]|10|2[0-29]|30|" . "40|50|60|7[0-9]|8[12]|90)|4(?:0[0-39]|10|20|40|50|60|" . "70|80|9[0-49])|5(?:00|20|30|40|50|7[0-39]|90)|" . "6(?:0[0-49]|10|20|30|40|60|70)|7(?:0[0-589]|10|20|30|" . "90)|8(?:0[0-24-9]|70))|" . "4(?:0(?:0[0-9]|1[0-6]|2[0145]|3[46]|4[01]|5[459])|" . "1(?:0[0-9]|1[0-3]|20|3[0-79]|40|5[0-9]|6[0-69]|70|90)|" . "2(?:0[0-9]|10|20|30|40|50|60|70|90)|3(?:0[0-57-9]|" . "1[014]|20|3[0-47-9]|40|50|60|7[0-4]|80|90)|" . "4(?:0[0-59]|10|20|30|40|50|60|70|80|90)|5(?:0[0-39]|" . "20|40|50|60|70|80)|6(?:0[0-79]|50|60)|7(?:0[0-469]|" . "40)|8(?:0[0-9]|90)|9(?:10|20|30|4[0-69]|5[0-4]|" . "6[0-469]|70|8[124-9]|9[013-9]))|" . "5(?:0(?:0[0-9]|1[0-9]|2[0134689]|3[0-689]|4[0-9]|5[1-689]|" . "6[0-9]|7[2-9]|8[0-9]|9[02-7])|1(?:0[0-9]|1[0-689]|" . "2[02-9]|3[01489]|4[0-24]|5[0-9]|6[1-9]|7[0-24679]|" . "8[0-24689]|9[124-8])|2(?:0[1-9]|1[0-9]|2[0-46-9]|" . "3[0-9]|4[01348]|5[0236]|6[0-69]|7[02589]|8[0-48]|" . "9[0-24589])|3(?:0[2-9]|1[0-57-9]|2[0-9]|3[0357-9]|" . "4[0-589]|5[0235-9]|6[0-7]|7[0-689]|8[0-9]|9[0-24-9])|" . "4(?:0[0-35-8]|1[0-35-9]|2[0-9]|3[0-24-9]|4[0-79]|" . "5[0-9]|6[02-8]|7[0-9]|8[0-8]|9[0-35-9])|5(?:0[2-9]|" . "1[0-2]|2[1-8]|3[3-8]|4[0-8]|5[0-8]|6[0-9]|7[0-9]|" . "8[0-9]|9[1-9])|6(?:0[0-9]|1[0-46-9]|2[0-9]|3[0-9]|" . "4[0-46-9]|5[0-9]|6[0-57-9]|7[013-57-9]|8[0-357-9]|" . "9[0-46-9])|7(?:0[0-35-9]|1[02-9]|2[0-79]|3[0-247-9]|" . "4[0-357-9]|5[03-79]|6[1-9]|7[0-358]|8[0-69]|9[04689])|" . "8(?:0[02-9]|1[2357-9]|2[0-9]|3[0-9]|4[013-9]|5[0-578]|" . "6[0-9]|7[0-24-9]|8[0-79]|9[0-57-9])|9(?:0[0-57-9]|" . "1[13-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-25-79]|7[0-9]|" . "8[013-9]|9[013-8]))|" . "6(?:0(?:0[0-8]|1[127-9]|2[0-24-689]|3[0-35-9]|4[0-79]|" . "5[0-9]|6[0-9]|7[0-249]|8[03-7]|9[2-9])|1(?:0[017-9]|" . "1[013679]|2[0-579]|3[0-9]|4[0-4]|5[0-359]|6[014]|" . "7[0-9]|8[135-9]|9[0-7])|2(?:0[0-9]|10|20|3[0-35-9]|40|" . "50|60|70|80|90)|3(?:0[0-68]|10|20|30|40|50|60|7[09]|" . "80|90)|4(?:0[0-59]|1[089]|20|30|40|50|60|70|80|90)|" . "5(?:0[0-49]|10|20|30|40|50|60|70|80|90)|6(?:00|10|20|" . "30|40|50|60|80|90)|7(?:00|10|2[013]|30|40|50|60|70|80|" . "90)|8(?:0[0-9]|10|2[13-5]|40|50|60|70|8[0-57]|90)|" . "9(?:0[02]|1[0457]|2[05-79]|3[045]|4[05]|50|60|70|80))|" . "7(?:0(?:0[0-9]|1[0-9]|2[013-8]|39|4[0-3]|5[0-2]|90)|" . "1(?:0[0-9]|1[0-58]|2[02-467]|3[013-589]|4[01458]|" . "5[0147]|6[03-79]|7[01346-8]|8[13-7]|9[0-9])|" . "2(?:0[0-9]|1[0-9]|2[0-59]|3[0-249]|4[0-36-9]|5[0-579]|" . "6[0-46]|7[0-2]|8[0-2]|9[0-9])|3(?:0[0-57-9]|1[0-689]|" . "2[07]|3[0-57]|4[0-46-9]|5[0-3]|60|70|8[0-24589]|90)|" . "4(?:0[0-579]|1[0-79]|2[0-79]|3[0-79]|4[0-8]|5[0-58]|" . "6[02-57-9]|70|8[0-46-9])|5(?:0[0-9]|1[05]|2[0-9]|" . "4[0-9]|5[0-9]|6[0-9]|70|8[0-35]|90)|6(?:0[0-9]|" . "1[0-24-7]|20|30|4[01569]|50|60|70|80|90)|7(?:0[0-689]|" . "1[014-7]|2[0-3]|30|50|60|7[126-9]|80|9[1-689])|" . "8(?:1[013-9]|20|3[0-57-9]|40|50|60|7[0-3569]|80|90)|" . "9(?:10|2[03]|3[0-39]|40|5[01]|61|70|8[1-369]|90))|" . "8(?:0(?:0[0-9]|1[0-57-9]|2[0-246-9]|3[02-5]|4[1-9]|" . "5[1-79]|6[0-24-7]|7[189]|8[1-9]|9[1-69])|" . "1(?:0[0-24-689]|1[0-9]|2[0-24-69]|3[0-59]|4[0-35-9]|" . "5[0-57-9]|6[02-79]|7[0-479]|8[0-689]|9[0-9])|" . "2(?:0[0-9]|1[0249]|2[0-39]|3[0-49]|4[0-49]|50|60|70|" . "8[0-9]|9[0-49])|3(?:0[0-46-9]|1[0-79]|2[0-2]|3[019]|" . "4[0-24-69]|5[0-69]|6[0-48]|7[0-9]|80|9[015])|" . "4(?:0[0-49]|1[0-35-79]|2[0-49]|3[019]|40|5[0178]|60|" . "7[0-29]|80|90)|5(?:0[0-79]|1[0-59]|20|3[0-69]|40|50|" . "60|70|80|9[0-29])|6(?:0[0-69]|1[029]|20|30|40|50|60|" . "70|80|90)|7(?:0[0-359]|1[0-58]|20|30|40|50|60|7[0189]|" . "80|90)|8(?:0[0-69]|10|20|30|40|5[0-249]|60|70|8[1-6]|" . "9[07])|9(?:1[05]|2[0-9]|3[01]|4[0-689]|5[05]|60|70|80|" . "9[05-7]))|" . "9(?:0(?:0[0-9]|1[0-8]|2[1-9]|3[0-9]|4[1-69]|5[0-69]|" . "6[0189]|7[0-79]|8[0-8]|9[1-389])|1(?:0[0-69]|10|20|30|" . "4[0-5]|50|60|70|8[0-2459]|90)|2(?:0[0-689]|10|20|" . "3[0-4]|40|50|60|70|90)|3(?:0[0-9]|10|20|30|40|50|60|" . "70|80|90)|4(?:0[0-49]|10|20|30|40|50|60)|5(?:00|10)|" . "600|700|800|9(?:39|5[03])))" . "|8(?:0(?:0(?:0[0-9]|1[0-79]|2[0-35-9]|3[0-46-9]|4[0-46-9]|" . "5[014-7]|6[0-489]|75|8[0-9]|9[0-79])|1(?:0[0-9]|" . "1[058]|2[02]|3[0-24-6]|4[02-6]|50|60|70|90)|" . "2(?:0[0-689]|10|20|30|40|50|60|70|90)|3(?:0[0-39]|10|" . "20|3[0-69]|40|50|60|70|90)|4(?:00|10|20|30|40|50|60|" . "70|80|90)|5(?:00|10|20|3[1-59]|40|50|60|70|80)|6(?:00|" . "10|20|30|40|50|70|80|90)|7(?:00|10|40|50|70|80)|" . "8(?:00|20|30|50|60|70|80|9[01])|9(?:1[09]|60|70|80))|" . "1(?:0(?:0[0-7]|1[1-9]|2[0-35-8]|3[014-9]|90)|1(?:0[0-9]|" . "1[056]|20|30|40|50|60|70|90)|2(?:0[0-9]|1[05]|20|30|" . "40|50|60|70|90)|3(?:0[0-5]|10|20|30|40|50|60|70|80|" . "90)|4(?:00|30|40|50|70|90)|5(?:0[0-369]|30|40|70|80)|" . "6(?:0[0-59]|30|40|60)|7(?:00|10)|800|990)|" . "2(?:0(?:0[0-689]|1[3-579]|2[47]|3[0237]|4[078]|5[347]|" . "6[057]|7[07]|8[07])|1(?:0[0-49]|10|20|30|40|50|60|70|" . "90)|2(?:0[0-28]|10|20|30|40|50|70|90)|3(?:0[0-3]|30|" . "40|50|60|70|90)|4(?:0[0-3]|10|40)|500|600|7(?:00|10)|" . "800)|" . "3(?:0(?:0[0-8]|1[2-69]|3[068]|4[0-289]|5[0-9]|6[0-59]|" . "7[016-9]|8[0-9]|9[0-57-9])|1(?:0[078]|1[019]|20|" . "3[016]|4[039]|50|6[0-467]|7[0-79]|8[013-57-9]|" . "9[0-269])|2(?:00|10|20|3[016-8]|40|50|60|70)|3(?:00|" . "1[0-7]|20|30|40|50|7[0-29]|80|90)|4(?:0[0-9]|1[128]|" . "20|30|40|60|70|8[0-9]|90)|5(?:0[0-479]|1[0-248]|20|30|" . "50|60|70|80|90)|6(?:0[0-4689]|1[03-68]|30|40|60|70|80|" . "90)|7(?:0[0-57]|20|40|80|90)|8(?:00|20|30|40|60|70|" . "90)|9(?:10|20|5[1-47]|80|9[0-8]))|" . "4(?:0(?:0[04-9]|1[013-689]|2[1-579]|3[1-6]|4[1-9]|" . "5[014689]|7[1278]|8[1-5]|9[0-9])|1(?:0[0-9]|10|2[0-4]|" . "3[0-59]|4[0-479]|50|60|70|90)|2(?:0[0-9]|10|20|3[0-2]|" . "40|50|60|7[0-9]|90)|3(?:0[0-9]|10|20|30|40|50|60|70|" . "80|90)|4(?:0[0-5]|10|20|30|40|50|60|70|80|90)|" . "5(?:0[0-57]|10|30|50|60|70|80)|6(?:0[0-39]|60)|" . "7(?:0[0-6]|40|50|60)|8(?:0[0-58]|10|20|30|40|50|60|" . "7[0-48])|9(?:0[1259]|1[1-9]|5[1-46]|6[13-57-9]|" . "7[1-367]))|" . "5(?:0(?:0[0-9]|1[0235-9]|2[01346]|3[356])|1(?:0[0-9]|" . "1[013489]|20|3[0-39]|40|50|6[0-579]|70|80|90)|" . "2(?:0[0-689]|10|20|30|40|50|60|70|80|9[0-29])|" . "3(?:0[0-79]|10|20|30|4[0-2]|50|60|70|90)|" . "4(?:0[0-4679]|10|20|30|40|50|60|70|80|90)|5(?:0[0-69]|" . "10|20|30|40|50|60|70|80|90)|6(?:0[0-479]|1[02-6]|20|" . "30|40|60|70|80|90)|7(?:0[0237-9]|10|40|50|70)|" . "80[03-69]|9(?:19|2[1-8]|3[0-4]))|" . "6(?:0(?:0[0-9]|1[0-3]|2[0-39]|3[04-68]|4[2-7]|5[0-6]|" . "6[0-35-9]|7[1-46]|8[0-9]|9[0-8])|1(?:0[0-9]|1[07]|20|" . "3[0-57-9]|40|50|60|70|80|90)|2(?:0[0-2469]|10|20|30|" . "40|50|60|70|8[0-29]|90)|3(?:00|10|20|30|40|50|6[0-29]|" . "70|80|90)|4(?:00|10|20|30|40|50|60|70|80|90)|" . "5(?:0[0-289]|10|30|40|50|80)|6(?:00|10)|700|800|" . "9(?:05|10|6[0-49]|8[0-4]))|" . "7(?:0(?:0[0-9]|1[0-35-8]|2[0-356]|3[0-46-9]|4[0-9]|" . "5[0-589]|6[015-9]|7[013-9]|8[0-59]|90)|1(?:00|10|20|" . "30|40|50|60|70|90)|2(?:0[0-356]|10|2[0-3]|30|40|50|60|" . "70|80|90)|3(?:00|10|20|30|40|50|60|70|80)|4(?:00|10|" . "20|30|40|60|70|80)|5(?:00|10|20|70|90)|6(?:00|20|40)|" . "7(?:00|20)|8(?:00|90)|9(?:00|19|20|30|50))|" . "8(?:0(?:0[0-9]|1[0-8]|2[015-79]|33|5[01]|60|8[4-689]|99)|" . "1(?:0[0-9]|10|2[0-3579]|3[0-39]|4[0-39]|5[0-6]|" . "6[0-259]|70|87|9[0-589])|2(?:0[0-79]|1[0-4]|20|30|40|" . "50|60|70|90)|3(?:0[0-7]|10|20|30|40|50|60|70|80|90)|" . "4(?:0[0-35-9]|10|20|30|40|50|60|70|80|90)|" . "5(?:0[0-479]|10|20|30|40|50|60|80)|6(?:00|30|40|50)|" . "700|80[0-59])|" . "9(?:0(?:0[0-79]|1[0-2569]|2[0-9]|30|89|9[0-59])|" . "1(?:0[0-9]|1[036]|20|30|4[04]|50|60|70|90)|" . "2(?:0[0-79]|10|20|30|40|50|60|70|90)|3(?:0[0-79]|10|" . "20|3[01]|40|50|60|80|90)|4(?:00|10|20|30|40|50|60|70|" . "80)|5(?:00|1[05]|2[05]|30|50|60|70|80)|6(?:00|30|60|" . "90)|7(?:00|10|40|7[0-2])|800))" . "|9(?:0(?:0(?:0[0-9]|1[0-689]|2[0-35]|40)|1(?:0[01]|10|20|30|40|" . "50|60|70)|200|3(?:00|30|40|50|60|70|80)|400|500|600|" . "700|8(?:00|50))|" . "1(?:0(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|" . "7[0-247-9]|80|9[07])|1(?:0[0-9]|2[0-9]|3[0-35-7]|" . "4[0-269]|5[0-46-9]|6[0-9]|7[0-47-9]|80|9[0-9])|" . "2(?:0[014579]|1[0134]|2[0-9]|30|4[01]|50|6[0-35-9]|70|" . "80|9[0-24-9])|3(?:0[0-9]|1[0-245]|2[0-589]|3[0-59]|" . "4[0-9]|5[013-59]|60|7[014]|8[0-9]|90)|4(?:0[0-79]|" . "1[024-8]|2[0-9]|30|40|50|6[0-3]|70|80|90)|5(?:10|20|" . "30|4[0-29]|5[01]|60|7[0-489]|80|90)|6(?:0[0-359]|" . "1[0239]|2[05]|30|40|50|60|70|80|9[0-9])|7(?:0[0-9]|" . "1[0-3]|20|30|4[0-9]|50|6[0-47]|70|8[013]|9[0-2])|" . "8(?:0[0-79]|1[0-5]|2[01]|30|4[019]|5[0-25]|6[01]|" . "7[0-9]|8[0-79]|9[0-689])|9(?:1[0-79]|2[1-4]|30|4[0-9]|" . "5[1-9]|6[1-9]|7[1-9]|8[1-68]))|" . "2(?:0(?:0[0-9]|1[0-9]|2[0-9]|3[3-9]|4[0-9]|5[0-9]|" . "6[013-9]|7[0-9]|8[1-9]|9[235-9])|1(?:0[0-689]|1[0-9]|" . "2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-9]|7[0-9]|8[1-689]|" . "9[013-69])|2(?:0[0-689]|1[0-69]|2[0-9]|3[0-57-9]|" . "4[0-79]|5[0-46-9]|6[0-369]|7[0-59]|8[0-246-8]|" . "9[0-35-8])|3(?:0[0-9]|1[0-46-9]|2[0-9]|3[0-379]|" . "4[0-2]|5[0-79]|6[0-69]|7[029]|8[08]|9[0-9])|" . "4(?:0[0-9]|1[0-9]|2[03]|3[08]|4[1-578]|54|99)|" . "5(?:0[0-9]|1[1346-9]|2[1-57-9]|3[1-8]|4[1-6]|5[235]|" . "6[1-79]|7[13-8]|8[1-8]|9[1-9])|6(?:0[0-79]|1[13-6]|" . "2[24]|3[1-8]|4[1-359]|5[013-689]|6[05]|7[12579]|" . "8[2-689]|9[1358])|7(?:0[0-9]|1[1-5]|2[125-9]|3[05-9]|" . "4[1-578]|5[12568]|6[1-46-8]|7[2-469]|8[1-9]|9[1-9])|" . "8(?:0[0-9]|1[135-9]|2[0-4]|4[2-8]|5[1-69]|6[1-7]|" . "8[1-79]|9[1-8])|9(?:0[1-46-9]|1[1-9]|2[0-9]|3[0-9]|59|" . "7[0-57-9]|8[013-9]|99))|" . "3(?:0(?:0[0-35-9]|1[1-46-8]|2[124])|1(?:0[0-8]|1[0-24-8]|" . "2[0-367]|3[013-6]|4[0-9]|5[0-8]|6[0-9]|7[0-24-7]|" . "8[1-46-9]|9[0-79])|2(?:0[0-9]|1[0-46-9]|2[0-2]|" . "3[0135]|4[015]|50|6[01]|7[0145]|8[2-6]|9[047])|" . "3(?:0[0-8]|1[015]|2[0-5]|3[0-24-7]|4[0-689]|5[0-2]|" . "6[0-6]|70|8[0-2]|90)|4(?:0[0-8]|1[0-2]|2[0-4]|3[0167]|" . "4[01]|5[013-8]|6[0-5]|7[0239]|8[1-79]|93)|5(?:0[0-8]|" . "1[1-7]|2[1-46-8]|3[1-9]|4[1457]|5[4-68]|6[1-4]|" . "7[14-8]|8[1-9]|9[13])|6(?:0[0-689]|1[1-9]|2[1-37]|31|" . "9[1-9])|7(?:0[015]|1[129]|3[1346-8]|61)|8(?:0[0-267]|" . "1[2-6]|8[13-57]|9[19])|90[17-9])|" . "4(?:0(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[1-5]|94)|" . "1(?:0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-69]|" . "7[0-5]|9[0-79])|2(?:0[0-9]|1[0149]|2[0-9]|3[0-9]|" . "4[0-4679]|5[0-9]|6[0-9]|7[0-9]|81|90)|3(?:0[0-9]|" . "1[0-29]|2[0-247]|4[0-59]|5[013-79]|6[0-689]|7[0-9]|" . "8[0-9]|9[0-689])|4(?:0[0-9]|1[0-579]|20|3[0-9]|40|" . "5[0-79]|60|7[0-9]|80|90)|5(?:0[0-9]|1[0-9]|2[0-8]|" . "3[1-9]|4[1-46-9]|5[0-3]|6[1-9]|7[1-9]|8[1-9]|9[1-9])|" . "6(?:0[0-4679]|1[1-46-9]|2[1-36-8]|3[1-9]|4[1-578]|" . "5[1346-9]|6[13479]|7[1-9]|8[1-8])|7(?:0[0-4679]|" . "1[0-59]|2[1-9]|3[1-9]|4[1-589]|6[1-8]|8[1-59])|" . "8(?:0[0-9]|1[1-9]|3[1-39]|5[1-9]|6[1-79]|80|9[1-4])|" . "9(?:4[125-9]|5[1-689]|6[1-68]|7[1-8]))|" . "5(?:0(?:0[0-8]|1[0-9]|2[0-57-9]|3[0-8]|4[0-26]|5[0-69]|" . "6[0-79]|7[0-9]|9[0-8])|1(?:0[0-9]|1[0-27-9]|2[0-79]|" . "3[0-579]|4[0-6]|5[0-57-9]|6[0-259]|70|80|9[0-9])|" . "2(?:0[0-79]|1[0-9]|2[0-4689]|3[0-49]|40|5[0-29]|60|70|" . "80|90)|3(?:0[0-469]|1[0-689]|2[0-489]|3[0-5]|40|" . "5[015]|60|7[09]|80|90)|4(?:00|1[0-29]|20|30|4[015]|50|" . "6[01]|7[0-9]|80|90)|5(?:0[0-9]|10|2[0-9]|30|40|5[019]|" . "60|7[013]|80|90)|6(?:0[0-59]|1[0-9]|20|30|40|5[0-29]|" . "60|70|80|9[0-367])|7(?:0[0-9]|1[0-3569]|2[0-7]|3[1-4]|" . "4[0-27]|50|6[019]|70|80)|8(?:0[0-9]|1[0-6]|20|30|" . "4[02-4]|50|6[1-68]|7[0-79]|80|9[127])|9(?:0[12578]|" . "1[1-3569]|2[0-8]|3[0-4]|4[0-9]|5[0-46-9]|7[0-8]))|" . "8799)" . ")", # # 5 Digit postal code, with leading 0s. # # Data from: http://download.geonames.org/export/zip/DE.zip # Germany => "(?k:0(?:1(?:0(?:6[79]|9[79])|1(?:0[89]|2[79]|39|5[679]|69|8[79])|" . "2(?:1[79]|3[79]|5[79]|7[79])|3(?:0[79]|14|2[468])|" . "4(?:45|5[48]|6[258]|7[178])|5(?:58|61|8[79]|9[14])|" . "6(?:09|1[269]|23|40|6[25]|8[39])|7(?:05|2[38]|3[1478]|" . "44|6[28]|7[3468]|96)|8(?:09|1[469]|2[459]|33|4[478]|" . "55|77|96)|9(?:0[0469]|17|20|36|45|68|79|8[37]|" . "9[03468]))|" . "2(?:6(?:2[57]|33|4[03]|8[19]|9[249])|7(?:08|27|3[0369]|" . "4[278]|63|79|8[258]|9[14679])|8(?:2[6-9]|9[49])|" . "9(?:06|2[39]|43|5[3679]|7[79]|9[1479]))|" . "3(?:0(?:4[2468]|5[0-58]|9[69])|1(?:03|1[69]|3[09]|49|59|" . "72|85|97)|2(?:0[25]|2[269]|38|4[69]|53))|" . "4(?:1(?:0[3579]|29|5[57-9]|7[7-9])|2(?:0[579]|29|49|" . "7[579]|8[89]|99)|3(?:1[5-9]|2[89]|4[79]|5[67])|4(?:16|" . "2[05]|35|42|51|6[03])|5(?:09|19|23|39|52|6[457]|" . "7[1459])|6(?:0[03]|1[0378]|26|39|43|5[1457]|68|" . "8[03578])|7(?:03|20|36|4[169]|58|69|7[49])|8(?:08|" . "2[1478]|38|49|6[02]|74|8[069]|95)|9(?:1[06]|2[48]|" . "3[12468]))|" . "6(?:1(?:08|1[02468]|2[02468]|3[02]|79|8[48]|9[38])|2(?:17|" . "3[17]|4[269]|5[4589]|68|79|95)|3(?:08|1[1378]|33|" . "4[378]|6[69]|8[568])|4(?:0[68]|2[059]|49|5[68]|" . "6[34679]|84|93)|5(?:0[27]|2[68]|3[67]|4[2378]|56|67|" . "7[178])|6(?:18|28|3[268]|4[278]|67|79|8[268])|7(?:12|" . "2[124579]|31|49|66|7[349]|8[056]|9[1246])|" . "8(?:0[03489]|4[24679]|6[129]|8[689]|9[56])|9(?:0[159]|" . "1[78]|2[2568]))|" . "7(?:3(?:18|3[03468]|4[39]|56|6[68]|8[179])|4(?:07|" . "2[2679])|5(?:4[5689]|5[1247]|70|8[069])|6(?:07|1[369]|" . "29|39|46)|7(?:4[3579]|51|68|7[48])|8(?:06|19)|9(?:07|" . "19|2[24679]|37|5[02578]|73|8[0579]))|" . "8(?:0(?:5[68]|6[0246])|1(?:07|1[258]|3[24]|4[147])|2(?:09|" . "2[38]|3[3679]|48|58|6[12579]|8[09]|9[47])|3(?:0[149]|" . "1[258]|2[14-68]|4[049]|5[259]|7[13]|9[36])|4(?:12|" . "2[78]|3[29]|5[19]|68|85|9[169])|5(?:2[3579]|3[89]|" . "4[1378])|6(?:06|26|4[58]))|" . "9(?:0(?:28|30)|1(?:1[1-4679]|2[0235-8]|3[01])|2(?:1[27]|" . "2[1478]|3[256]|4[1349])|3(?:06|2[268]|37|5[0356]|66|" . "76|8[057]|9[02459])|4(?:05|19|2[379]|3[02579]|56|" . "6[58]|7[147]|8[1478]|96)|5(?:09|1[478]|26|4[48]|57|69|" . "7[3579]|99)|6(?:0[03]|1[89]|2[379]|3[348]|48|6[19])))" . "|1(?:0(?:1(?:1[579]|7[89])|24[3579]|3(?:1[57-9]|6[579])|" . "4(?:0[579]|3[579])|5(?:5[13579]|8[579])|62[3579]|" . "7(?:0[79]|1[13579]|7[79]|8[13579])|82[3579]|" . "9(?:6[13579]|9[79]))|" . "1011|2(?:0(?:4[3579]|5[13579]|99)|1(?:0[13579]|5[79]|" . "6[13579])|2(?:0[3579]|4[79]|7[79])|3(?:0[579]|4[79]|" . "5[13579])|4(?:3[579]|59|8[79])|5(?:2[4679]|5[579]|" . "8[79])|6(?:19|2[1379]|79|8[13579]))|" . "3(?:0(?:47|5[13579]|8[689])|1(?:2[579]|5[689]|8[79])|" . "3(?:4[79]|5[13579])|4(?:0[3579]|3[579]|6[579])|" . "5(?:0[3579]|8[13579]|9[13579])|62[79])|" . "4(?:0(?:5[023579]|89)|1(?:09|29|31|6[3579]|9[3579])|" . "4(?:6[179]|7[1368]|8[02])|5(?:13|32|4[278]|5[02478])|" . "6(?:12|2[147]|41|56|6[29])|7(?:1[25]|2[78]|7[02468]|" . "89|9[378])|8(?:06|2[2378])|9(?:13|29|4[37]|59|7[49]))|" . "5(?:2(?:3[0246]|9[59])|3(?:06|2[0468]|4[45]|66|7[02478])|" . "5(?:1[78]|2[68]|37|6[269])|7(?:11|3[28]|4[15689]|" . "5[124578])|8(?:06|27|3[1478]|48|59|6[48]|9[08])|" . "9(?:07|1[03]|26|3[68]))|" . "6(?:2(?:2[57]|30|4[478]|59|69|78)|3(?:0[367]|21|4[18]|" . "5[269])|5(?:15|4[078]|5[269]|6[257])|7(?:27|6[167]|75|" . "9[28])|8(?:1[68]|27|3[1357]|45|6[68])|9(?:09|18|2[18]|" . "4[59]))|" . "7(?:0(?:3[3469]|8[79]|9[1489])|1(?:09|11|2[169]|39|5[349]|" . "6[68]|79|9[24])|2(?:0[79]|1[3479]|3[57]|48|5[2589]|68|" . "79|91)|3(?:09|2[12689]|3[57]|4[89]|58|67|7[359]|89|" . "9[0-28])|4(?:06|19|2[49]|38|4[09]|5[49]|89|9[1358])|" . "50[69])|" . "8(?:0(?:5[579]|69)|1(?:0[679]|19|4[67]|8[124]|9[0568])|" . "2(?:09|11|25|3[01369]|4[69]|58|7[369]|9[29])|" . "3(?:1[147]|20|3[47]|47|56|7[45])|4(?:3[579]|4[25]|" . "6[159])|5(?:07|1[0369]|28|46|5[16]|6[59]|7[34]|8[16])|" . "609)|" . "9(?:0(?:5[3579]|6[13579]|7[13579]|8[69])|2(?:0[59]|17|30|" . "4[369]|58|60|73|88|94)|3(?:0[0369]|22|3[69]|48|57|" . "7[0246]|86|9[59])|4(?:06|1[27])))" . "|2(?:0(?:0(?:38|88|9[579])|14[4689]|2(?:49|5[13579])|35[04579]|" . "45[79]|53[579])|" . "1(?:0(?:29|3[13579]|7[3579])|1(?:0[79]|29|4[79])|" . "2(?:1[78]|2[0478]|44|5[5689]|6[16]|7[1249])|" . "3(?:3[579]|5[478]|6[0589]|7[169]|8[02568]|9[14578])|" . "4(?:0[013679]|23|3[5689]|4[124579]|65|8[13]|93)|" . "5(?:0[29]|1[46]|2[124679])|6(?:14|29|35|4[0134679]|" . "8[02-4]|98)|7(?:0[269]|1[0247]|2[03679]|3[02479]|45|" . "5[56]|6[2359]|7[0256]|8[124579]))|" . "2(?:0(?:4[13579]|8[13579])|1(?:1[13579]|4[3579]|59|" . "7[579])|29[79]|3(?:0[13579]|3[579]|59|9[13579])|" . "4(?:1[579]|5[3579])|5(?:2[3579]|4[79]|59|8[79])|" . "60[579]|76[13579]|8(?:4[468]|5[01]|69|8[059])|" . "9(?:2[679]|4[169]|5[25689]|6[24579]))|" . "3(?:5(?:39|5[2468]|6[024689]|70)|6(?:1[179]|2[36-9]|69|" . "8[349])|7(?:01|1[4579]|3[08]|4[34679]|58|69|7[4579]|" . "95)|8(?:1[23568]|2[0134679]|4[357]|58|6[03679]|79|" . "8[13]|9[689])|9(?:09|1[19]|23|36|4[2468]|52|6[68]|" . "7[024]|9[269]))|" . "4(?:1(?:0[35-79]|1[134689]|4[35-9]|59|61)|2(?:1[147]|" . "2[02369]|3[2589]|4[124578]|5[0134679])|3(?:06|2[1679]|" . "40|5[1478]|6[0134679]|76|9[2589])|40[124579]|" . "5(?:3[4679]|58|68|76|8[29]|9[48])|6(?:01|1[0369]|" . "2[0235689]|3[124578]|4[0134679])|7(?:68|8[2-47]|" . "9[0134679])|8(?:0[0235689]|1[134679]|37|48|5[0257]|" . "6[0134679]|7[0235689]|8[124578]|9[0134679])|9(?:3[79]|" . "4[134]|55|6[0369]|7[25-7]|8[03689]|9[124679]))|" . "5(?:3(?:3[5-7]|48|5[58]|6[1458]|7[013679])|4(?:04|2[19]|" . "3[67]|51|6[29]|7[49]|8[25689]|9[124579])|5(?:24|4[18]|" . "5[147]|6[0369]|7[235689]|8[124578]|9[0134679])|693|" . "7(?:0[49]|1[2589]|2[14579]|46|6[147]|7[0469]|8[2568]|" . "9[124579])|8(?:13|2[16]|3[26]|4[0259]|5[0235689]|" . "6[02-4689]|7[0235689]|8[124579]|99)|9(?:17|2[03467]|" . "38|46|80|9[2679]))|" . "6(?:1(?:2[1-3579]|3[135]|6[09]|8[08]|97)|2(?:0[39]|1[59])|" . "3(?:16|4[059]|8[24689])|4(?:09|19|27|34|4[16]|52|65|" . "74|8[679])|5(?:06|2[49]|32|48|5[36]|7[19])|6(?:0[357]|" . "2[49]|3[29]|55|7[06]|8[39])|7(?:2[135]|36|5[79]|89)|" . "8(?:02|1[07]|26|3[15]|4[24579]|71|9[279])|" . "9(?:0[134679]|19|3[15-79]|54|69))|" . "7(?:2(?:11|3[29]|4[35689]|5[12479]|83|99)|3(?:0[58]|1[38]|" . "2[147]|3[03679]|56|67|74|8[369])|4(?:04|1[29]|32|" . "4[269]|7[2468]|9[89])|5(?:68|7[02468]|80)|6(?:07|" . "1[269]|2[48]|3[278])|7(?:11|2[169]|49|5[135]|77|" . "9[38])|80[149])|" . "8(?:19[579]|2(?:0[13579]|1[13579]|3[79]|59|7[79])|" . "3(?:0[79]|2[579]|35|5[579])|7(?:1[79]|5[579]|7[79]|" . "90)|8(?:16|32|44|57|65|7[069]))|" . "9(?:22[13579]|3(?:0[38]|13|2[038]|3[169]|4[258]|" . "5[1-35689]|6[124579]|7[89]|8[69]|9[2-469])|4(?:1[036]|" . "39|5[169]|6[258]|7[1-35689]|8[124578]|9[0134679])|" . "5(?:25|49|5[369]|6[258]|7[14-689]|8[124578]|" . "9[0134679])|6(?:14|33|4[0369]|64|83|9[039])))" . "|3(?:0(?:1(?:59|6[13579]|7[13579])|4(?:19|49|5[13579])|5(?:19|" . "21|39|59)|6(?:2[579]|5[579]|69)|8(?:2[367]|5[135]|80|" . "90)|9(?:00|16|26|38|52|66|74|8[29]))|" . "1(?:0(?:08|2[089]|3[23569]|61|7[39]|8[457-9]|9[134679])|" . "1(?:3[4579]|41|57|6[27]|7[147]|8[058]|9[1569])|" . "2(?:2[468]|34|4[169]|75)|3(?:03|1[19])|5(?:15|35|" . "4[27]|5[235689]|82|9[25])|6(?:0[034689]|1[389]|" . "2[1-36-9]|3[2-46-8]|55|75|8[38]|9[1389])|7(?:0[0278]|" . "1[0-2457-9]|37|49|8[579])|8(?:12|32|4[08]|55|6[0378]))|" . "2(?:0(?:49|5[12])|1(?:0[578]|20|3[09])|2(?:57|78|89)|" . "3(?:12|39|51|6[19])|4(?:2[3579]|57|69|79)|5(?:4[579]|" . "84)|6(?:0[29]|57|76|8[39]|9[49])|7(?:5[68]|60|91)|" . "8(?:05|16|25|3[29]))|" . "3(?:0(?:14|3[49]|98)|1(?:0[0246]|29|42|54|6[15]|7[58]|" . "8[149])|3(?:11|3[0245]|78|97)|4(?:15|28|4[29])|519|" . "6(?:0[24579]|1[13579]|4[79]|59|89|99)|7(?:19|29|39|58|" . "75|90)|8(?:03|1[38]|2[49]))|" . "4(?:1(?:1[79]|2[13578]|3[0-24])|2(?:12|25|33|46|53|6[06]|" . "7[07]|8[169]|9[258])|3(?:0[258]|1[147]|2[03679]|46|" . "5[59]|69|7[69]|8[58]|9[369])|4(?:14|3[149]|54|66|" . "7[1479]|97)|5(?:08|1[369]|37|49|60|76|8[27]|9[0369])|" . "6(?:13|2[168]|3[02379]))|" . "5(?:0(?:3[79]|4[13]|66|75|8[0358]|9[1469])|1(?:0[248]|" . "1[024679])|2(?:16|3[269]|60|7[49]|8[2578])|3(?:05|15|" . "2[1579]|9[02468])|4(?:1[058]|2[38]|35|4[047]|5[27]|" . "6[0369])|5(?:1[069]|7[689]|8[0-6])|6(?:06|1[49]|25|" . "3[038]|4[1479]|8[3-9]|90)|7(?:08|1[369]|45|5[369]|" . "6[478]|8[19]|9[2469]))|" . "6(?:0(?:3[79]|4[13]|88|93)|1(?:0[03]|1[059]|2[49]|3[27]|" . "4[258]|5[147]|6[03679]|79|99)|2(?:0[58]|1[1479]|51|" . "6[69]|7[257]|8[024679])|3(?:04|18|2[03569]|41|5[58]|" . "6[479]|81|9[169])|4(?:04|1[49]|33|48|5[267]|6[069]))|" . "7(?:0(?:7[3579]|8[135])|1(?:15|2[047]|3[0369]|54|7[06]|" . "8[16]|9[1479])|2(?:1[3-8]|35|4[279]|69|76|8[147]|" . "9[03679])|3(?:08|18|27|39|45|5[159])|4(?:12|3[14]|" . "4[14579])|5(?:20|3[49]|47|74|8[169])|6(?:03|19|2[07]|" . "3[2359]|4[02379]|71|88|9[1679]))|" . "8(?:023|1(?:0[02468]|1[02468]|2[0246]|5[49]|6[25]|" . "7[0369])|2(?:2[689]|39|59|68|7[124579]|81)|3(?:0[024]|" . "1[259]|2[124579]|50|6[48]|7[235689]|8[124578])|" . "4(?:4[02468]|5[89]|6[124578]|7[0134679]|8[69])|5(?:18|" . "2[478]|3[01369]|4[237]|5[0134679])|6(?:4[024]|67|78|" . "85|90)|7(?:0[0479]|2[39])|8(?:2[0289]|3[568]|55|" . "7[1579]|89|9[59]))|" . "9(?:014|1(?:0[468]|1[02468]|2[02468]|30|6[47]|7[159])|" . "2(?:18|21|4[059]|6[14]|79|88|91)|3(?:07|1[79]|26|" . "4[035]|5[69]|65|87|9[378])|4(?:18|3[459]|4[3468])|" . "5(?:17|24|39|7[69]|9[069])|6(?:06|1[59]|2[49]|38|" . "4[69])))" . "|4(?:0(?:2(?:1[0-3579]|2[13579]|3[13579])|4(?:68|7[024679]|89)|" . "5(?:4[579]|89|9[13579])|6(?:2[579]|6[78]|70|99)|" . "7(?:2[134]|64|89)|8(?:22|32|78|8[0235]))|" . "1(?:06[135689]|1(?:69|79|89|99)|23[689]|3(?:34|52|6[36]|" . "7[29])|4(?:6[024689]|7[02])|5(?:1[5-7]|39|4[0-2]|" . "6[49])|7(?:4[7-9]|51)|8(?:12|36|4[49]))|" . "2(?:1(?:0[3579]|1[13579])|2(?:7[579]|8[13579])|3(?:2[79]|" . "49|69|89|99)|4(?:77|89|99)|5(?:49|5[135]|79)|" . "6(?:5[13579]|9[79])|7(?:19|81|99)|8(?:5[3579]|9[79])|" . "929)|" . "4(?:1(?:3[579]|4[13579])|2(?:2[579]|6[3579]|8[79])|3(?:09|" . "19|2[89]|39|5[79]|69|79|88)|5(?:3[246]|7[579]|81)|" . "6(?:2[357-9]|49|5[1-3])|7(?:8[79]|9[13579])|" . "8(?:0[13579]|6[679]|79|9[24]))|" . "5(?:1(?:2[78]|3[0134689]|4[13-579])|2(?:19|39|5[79]|" . "7[679]|89)|3(?:0[79]|2[679]|5[5-79])|4(?:03|68|" . "7[0235689]|81)|5(?:2[579]|49)|6(?:5[79]|6[135]|99)|" . "7(?:01|11|21|3[19]|68|7[02])|8(?:79|8[134689]|" . "9[124679])|96[468])|" . "6(?:04[579]|1(?:1[79]|4[579])|2(?:3[68]|4[024]|8[246])|" . "3(?:25|4[28]|5[49]|9[579])|4(?:1[49]|46|59|8[357]|99)|" . "5(?:09|1[49]|3[579]|6[29]))|" . "7(?:05[1357-9]|1(?:19|3[7-9]|6[679]|7[89]|9[89])|" . "2(?:2[689]|39|49|59|69|79)|4(?:4[1357]|75|95)|" . "5(?:0[69]|33|46|5[19]|74|89)|6(?:08|2[3-7]|38|47|52|" . "6[159])|79[89]|8(?:0[02-579]|29|39|77)|9(?:06|18|29))|" . "8(?:079|1(?:4[3579]|5[13579]|6[1357])|2(?:31|49|68|82|91)|" . "3(?:0[18]|17|2[49]|36|4[16]|5[16]|6[169])|4(?:29|" . "3[12]|55|65|77|8[058]|9[369])|5(?:2[79]|31|65|99)|" . "6(?:07|1[29]|2[49]|53|83|91)|7(?:03|12|2[07]|3[49]))|" . "9(?:0(?:7[468]|8[02468]|90)|1(?:24|34|43|52|63|7[069]|86|" . "9[16])|2(?:0[15]|1[49])|3(?:2[468]|56|77|93)|" . "4(?:0[16]|1[39]|2[49]|3[49]|48|5[13679]|7[79]|9[27])|" . "5(?:0[49]|25|36|4[59]|65|77|8[46]|9[34679])|6(?:10|" . "2[46]|3[2578]|61|8[158]|9[269])|7(?:16|33|4[04]|5[17]|" . "6[27]|7[0479])|8(?:0[89]|11|2[48]|3[258]|4[34679])))" . "|5(?:0(?:1(?:2[679]|69|7[01]|8[19])|2(?:26|59)|3(?:21|54|74|" . "89)|6(?:6[78]|7[0246-9])|7(?:3[3579]|6[579])|" . "8(?:2[3579]|5[89])|9(?:3[13579]|6[89]|9[679]))|" . "1(?:06[13579]|1(?:0[3579]|4[3579])|3(?:7[13579]|81|99)|" . "4(?:2[79]|6[579]|91)|5(?:03|1[59]|45|70|8[08]|9[78])|" . "6(?:4[357]|74|88)|7(?:0[29]|66|89))|" . "2(?:0(?:6[2468]|7[02468]|80)|1(?:34|46|5[269])|2(?:2[2-4]|" . "49)|3(?:49|5[135]|7[29]|8[258]|9[1369])|4(?:28|4[15]|" . "5[79]|77|99)|5(?:11|25|3[18]))|" . "3(?:1(?:1[13579]|2[13579]|7[3579])|22[579]|3(?:32|4[037]|" . "59)|4(?:2[46]|74|89|98)|5(?:0[15-8]|18|20|3[349]|" . "4[57]|57|6[027]|7[27-9])|6(?:04|19|39)|7(?:21|57|73|" . "83|97)|8(?:0[49]|19|4[024]|59|79|81|94)|9(?:0[29]|" . "1[39]|25|37|4[0579]))|" . "4(?:29[02-68]|3(?:0[689]|1[01346-8]|2[09]|3[128]|" . "4[0134679])|4(?:1[13]|2[124679]|39|41|5[0135-79]|" . "7[02]|8[3467]|9[278])|5(?:1[68]|2[34689]|3[134689]|" . "5[028]|68|7[04689]|8[4-79]|9[57])|6(?:08|1[0-24679]|" . "3[46]|4[679]|5[57]|6[24689]|7[35]|8[79]))|" . "5(?:1(?:1[68]|2[0246-9]|3[01])|2(?:18|3[2479]|46|5[27]|" . "6[238]|7[0168]|8[368]|9[1469])|4(?:1[13]|2[245]|" . "3[0257]|4[24]|5[0279]|69|71|8[137]|9[014679])|" . "5(?:4[356]|59|6[689]|7[168]|8[35]|9[0235-79])|" . "6(?:0[68]|1[89]|2[14679])|7(?:43|5[68]|6[578]|" . "7[4679]))|" . "6(?:0(?:68|7[0235-7])|1(?:12|3[023]|54|7[09]|82|91)|" . "2(?:0[346]|18|20|3[57]|4[249]|5[34]|69|7[16]|8[138]|" . "9[01459])|3(?:0[57]|1[67]|2[1-39]|3[023578]|4[01689]|" . "5[57]|68|7[079])|4(?:1[024]|2[2478]|5[79]|62|7[0279])|" . "5(?:6[467]|7[59]|8[147-9]|9[3489])|6(?:26|3[07]|" . "4[258]|5[1369])|7(?:2[79]|36|4[356]|5[1349]|6[1679])|" . "8(?:1[248]|2[0135689]|4[13]|5[0689]|6[124579]))|" . "7(?:0(?:7[2468]|80)|2(?:23|34|5[08]|71|9[09])|3(?:19|" . "3[49]|68|9[29])|4(?:13|39|62|8[29])|5(?:18|20|3[79]|" . "48|55|6[27]|7[278]|8[0134679])|6(?:1[024]|2[79]|" . "3[25689]|4[124578]))|" . "8(?:0(?:89|9[13579])|1(?:19|35)|2(?:39|56|85)|3(?:00|13|" . "3[29])|45[2-6]|5(?:0[79]|1[135]|40|53|66|79)|" . "6(?:3[68]|4[024]|75)|7(?:0[68]|10|3[09]|6[29]|91)|" . "8(?:0[29]|4[09]))|" . "9(?:0(?:6[3579]|7[1357])|1(?:74|9[29])|2(?:2[79]|69)|" . "3(?:02|2[09]|48|68|79|87|9[49])|4(?:2[357]|39|57|69|" . "94)|5(?:05|1[049]|5[5-8]|81|9[07])|60[29]|75[579]|" . "8(?:2[13]|46|72|89)|9(?:09|29|39|55|6[49])))" . "|6(?:0(?:3(?:08|1[13468]|2[0235-79]|8[5689])|4(?:3[1357-9]|" . "8[6-9])|5(?:2[89]|49|9[4689]))|" . "1(?:1(?:18|3[078]|69|84|9[147])|2(?:0[0369]|3[19]|50|67|" . "7[369])|3(?:48|5[02]|8[19])|4(?:4[09]|62|7[69]))|" . "3(?:0(?:6[579]|7[135])|1(?:10|28|50|65|79)|2(?:25|63)|" . "3(?:03|2[29])|4(?:05|5[02467]|77|86)|5(?:0[05]|1[27]|" . "26|3[38]|4[369]|7[19]|8[49]|9[49])|6(?:07|19|28|" . "3[3679]|54|67|7[49]|8[38]|9[14579])|7(?:39|4[13]|55|" . "6[28]|7[36]|85|9[16])|8(?:0[18]|1[14]|2[05689]|3[149]|" . "4[0369]|5[367]|6[0347-9]|7[124579]|97)|9(?:06|1[16]|" . "2[04578]|3[0134679]))|" . "4(?:2(?:8[3579]|9[1357])|3(?:19|31|4[27]|54|67|72|8[05]|" . "9[057])|40[14579]|5(?:21|46|6[09]|7[29]|8[49])|6(?:25|" . "46|5[38]|6[58]|7[38]|8[369])|7(?:11|20|3[29]|4[37]|" . "5[034679])|8(?:07|23|3[29]|46|5[039]))|" . "5(?:1(?:8[3579]|9[13579])|2(?:0[1357]|19|2[0-4]|3[29])|" . "3(?:07|2[169]|4[3-7]|66|75|8[58]|9[169])|4(?:28|39|51|" . "6[28]|7[49])|5(?:10|2[079]|49|5[0-68]|8[29]|9[479])|" . "6(?:0[46]|1[148]|2[034679])|7(?:19|60|79|95)|" . "8(?:1[27]|24|3[05]|43)|9(?:29|3[1346]))|" . "6(?:1(?:1[13579]|2[135-9]|3[0-3])|2(?:65|71|8[07]|9[29])|" . "3(?:33|46|5[29]|86|99)|4(?:24|40|5[039]|8[24]|97)|" . "5(?:0[0134679]|3[89]|40|57|64|7[18]|8[39])|6(?:06|" . "2[059]|36|4[069]|63|79|87|93)|7(?:0[169]|40|63|73|" . "8[07]|9[38])|8(?:0[269]|22|39|49|51|6[29]|7[179]|" . "8[257]|9[24])|9(?:0[13479]|1[4679]|5[3-57]|69|7[68]|" . "8[179]|9[469]))|" . "7(?:0(?:59|6[13579]|71|98)|1(?:05|1[27]|2[25-7]|3[346]|" . "4[1679]|5[027-9]|6[15-79])|2(?:2[79]|4[056]|5[1689]|" . "69|7[138]|8[013]|9[2457])|3(?:0[4578]|1[01679]|46|54|" . "6[013568]|7[346-8])|4(?:3[3-5]|5[49]|6[68]|7[1-35]|" . "8[02379])|5(?:4[79]|5[01]|7[4578]|8[0235-7]|" . "9[0-35689])|6(?:5[3579]|6[13]|7[78]|8[01568]|9[1379])|" . "7(?:0[015-7]|1[4-68]|2[2457-9]|3[12457]|4[24-689]|" . "5[2-4679])|8(?:0[68]|1[134679]|2[1-4679]))|" . "8(?:1(?:59|6[13579]|99)|2(?:19|29|39|59)|30[579]|5(?:19|" . "26|35|4[29])|6(?:23|4[279])|7(?:23|53|66|75|8[29]|" . "9[49])|80[49])|" . "9(?:1(?:1[578]|2[01346]|51|68|81|9[08])|2(?:07|14|2[16]|" . "3[149]|4[25]|5[0134679])|4(?:12|2[79]|3[4679]|69|" . "8[38]|93)|5(?:0[29]|1[478])))" . "|7(?:0(?:1(?:7[3468]|8[02468]|9[0-3579])|3(?:2[79]|7[2468])|" . "4(?:3[579]|69|99)|5(?:6[3579]|9[79])|6(?:19|29)|" . "7(?:3[46]|71|94)|8(?:06|25|39))|" . "1(?:0(?:3[24]|6[3579]|8[38]|93)|1(?:0[16]|1[16]|2[06]|" . "3[149]|4[49]|5[4579])|2(?:29|54|63|7[27]|8[27]|" . "9[2679])|3(?:3[246]|64|84|9[47])|40[49]|5(?:22|" . "4[0369]|54|6[036]|7[03679])|6(?:3[468]|4[02]|65|7[29]|" . "86|9[16])|7(?:0[16]|1[178]|2[0369]|3[2579]))|" . "2(?:07[0246]|1(?:08|1[69]|2[47]|3[158]|4[14579]|60|7[258]|" . "8[1469])|2(?:02|1[38]|2[14679]|50|7[05]|8[05]|" . "9[0134679])|3(?:36|48|5[15689]|6[124579]|79|93)|" . "4(?:0[16]|1[14579]|5[89]|6[19]|7[4579]|88)|5(?:0[15]|" . "1[0134679]|25|3[124579]|55|74|8[124579])|6(?:22|" . "3[169]|4[49]|5[4578]|6[0134679])|7(?:6[02468]|70|93)|" . "8(?:0[05]|1[038]|2[079]))|" . "3(?:0(?:3[357]|54|6[16]|7[29]|8[47]|9[2589])|" . "1(?:0[124578]|1[0134679])|2(?:07|3[05]|4[09]|5[27]|" . "6[25689]|7[124578])|3(?:12|2[69]|3[37]|4[024579])|" . "4(?:3[0-4]|4[17]|5[037]|6[03679]|79|8[5689]|" . "9[124579])|5(?:2[579]|4[07]|5[037]|6[035689]|" . "7[124579])|6(?:14|3[05]|42|5[05]|6[03679])|7(?:28|" . "3[02-4]|6[05]|7[0369]))|" . "4(?:0(?:7[2468]|8[01])|1(?:7[27]|8[29]|9[369])|2(?:06|" . "1[149]|2[369]|3[2589]|4[35689]|5[124579])|3(?:21|" . "3[67]|4[38]|5[47]|6[0369]|7[2469]|8[2589]|9[124579])|" . "4(?:05|17|2[034679])|5(?:23|3[258]|4[124579]|64|" . "7[259]|8[2569]|9[24579])|6(?:13|2[69]|3[2589]|53|" . "7[03679])|7(?:06|22|3[16]|4[034679])|8(?:21|3[1248]|" . "4[27]|5[058]|6[124579]|89)|9(?:0[69]|1[258]|2[14578]|" . "3[0134679]))|" . "5(?:0(?:15|3[18]|45|5[03679])|1(?:7[23579]|8[01]|96)|" . "2(?:03|1[07]|2[38]|3[369]|4[2589])|3(?:05|2[38]|" . "3[14579]|65|78|8[2579]|9[124579])|4(?:17|28|3[38]|" . "4[3679]))|" . "6(?:006|1(?:3[13579]|49|8[579]|99)|2(?:2[7-9]|75|87|97)|" . "3(?:07|16|27|3[27]|44|5[169])|4(?:37|48|56|6[17]|" . "7[034679])|5(?:3[024]|4[79]|71|9[3679])|6(?:46|6[19]|" . "76|8[49]|9[48])|7(?:0[3679]|26|44|5[16]|6[1478]|" . "7[0134679])|8(?:29|3[135]|4[68]|5[57]|6[35]|7[0279]|" . "8[79]|91))|" . "7(?:6(?:5[246]|94)|7(?:0[49]|16|2[38]|3[16]|4[0369]|56|" . "6[17]|7[036]|8[147]|9[0134679])|8(?:15|3[0369]|55|66|" . "7[16]|8[03679])|9(?:33|4[48]|55|6[036]|7[124578]))|" . "8(?:0(?:48|5[0246]|7[38]|8[3679]|98)|1(?:12|2[06]|3[26]|" . "4[1478]|66|76|8[37]|9[49])|2(?:24|3[49]|4[47]|5[0369]|" . "6[2679])|3(?:15|3[37]|4[35]|5[14579])|4(?:6[2457]|" . "7[69])|5(?:32|49|5[49]|6[47]|7[0369]|8[0235689]|" . "9[124578])|6(?:0[0134679]|28|47|5[258]|6[124579])|" . "7(?:13|27|3[03679]))|" . "9(?:098|1(?:0[02468]|1[0-2457]|8[39]|9[49])|2(?:06|1[159]|" . "2[47]|3[258]|4[149]|5[2468]|6[138]|7[1469]|8[0235689]|" . "9[124579])|3(?:12|3[16]|4[168]|5[0369]|6[124579]|79|" . "95)|4(?:00|1[058]|2[34679])|5(?:13|39|4[01]|7[68]|" . "8[589]|9[124579])|6(?:18|39|50|6[49]|7[47]|8[235689]|" . "9[124579])|7(?:13|25|3[03679]|61|7[147]|8[07]|9[038])|" . "8(?:0[124579]|22|37|4[38]|5[369]|6[258]|7[124579])))" . "|8(?:0(?:33[135-79]|469|53[89]|6(?:3[46-9]|8[679])|79[6-9]|" . "80[1-579]|9(?:3[3579]|9[23579]))|" . "1(?:24[13579]|3(?:69|7[13579])|47[5-79]|5(?:39|4[13579])|" . "6(?:6[79]|7[13579])|73[579]|82[579]|92[579])|" . "2(?:0(?:08|24|3[12]|4[19]|5[47]|6[14579])|1(?:10|31|40|52|" . "66|78|94)|2(?:05|1[16]|2[39]|3[479]|56|6[69]|7[25689]|" . "8[124578]|9[0134679])|3(?:19|27|35|4[03679]|62|77|" . "8[03679]|9[0235689])|4(?:0[124579]|18|3[1-35689]|" . "4[124579]|67|8[178]|9[0134679])|5(?:15|38|4[1479]))|" . "3(?:0(?:2[246]|43|5[29]|64|7[15]|8[038]|9[38])|1(?:0[149]|" . "1[259]|2[235689]|3[124579])|2(?:09|2[49]|3[36]|4[26]|" . "5[034679]|78)|3(?:0[18]|1[37]|2[49]|3[49]|4[2469]|" . "5[2589]|6[124578]|7[0134679]|95)|4(?:04|1[0367]|35|" . "5[1478]|71|8[3679])|5(?:12|27|3[0369]|4[34679]|" . "5[0235689]|6[124579])|6(?:07|2[034679]|46|6[16]|" . "7[0134679]|84)|7(?:0[0378]|14|27|3[04579]))|" . "4(?:0(?:28|3[0246]|48|5[16]|6[169]|7[269]|8[2589]|" . "9[124578])|1(?:0[0134679]|3[07]|4[049]|5[25]|" . "6[034689]|7[124578]|8[0134679])|3(?:07|2[369]|" . "3[23579]|47|59|6[47]|7[158]|8[14579])|4(?:05|1[69]|" . "2[478]|3[124579]|53|78|89|94)|5(?:0[38]|1[38]|2[49]|" . "3[39]|4[34679]|5[0235689]|6[124578]|7[0134679]))|" . "5(?:0(?:49|5[1357]|7[27]|8[048]|9[258])|1(?:0[147]|" . "1[0134679]|2[0235689]|3[124579])|2(?:2[19]|3[258]|" . "4[147]|5[034689]|76|83|9[0368])|3(?:0[124579]|5[46]|" . "68|7[56]|86|9[159])|4(?:0[2568]|1[0134679]|35|4[57]|" . "5[2679]|6[124579])|5(?:21|40|51|6[07]|7[09]|86|" . "9[189])|6(?:0[49]|1[47]|2[25]|3[05]|4[0369]|5[235689]|" . "6[124579])|7(?:16|37|48|57|64|7[478]))|" . "6(?:1(?:5[02-4679]|6[13579]|79|99)|3(?:16|43|56|68|81|" . "9[19])|4(?:05|15|2[04]|38|4[147]|5[0369]|6[25]|" . "7[03679]|8[0235689]|9[124578])|5(?:0[024578]|" . "1[013479]|29|5[14689]|6[124578]|7[0134679])|6(?:09|" . "3[37]|4[137]|5[0357]|6[03689]|7[2-689]|8[124578]|" . "9[024578])|7(?:0[0134679]|20|3[235689]|4[124578]|" . "5[0134679])|8(?:07|25|3[036]|4[25]|5[034679]|" . "6[0235689]|7[124579]|99)|9(?:1[169]|2[0235689]|" . "3[124578]|4[0134679]|56|7[124578]|8[0134679]))|" . "7(?:4(?:3[579]|48|5[29]|6[36]|7[147]|8[0478]|9[034679])|" . "5(?:09|27|3[48]|4[14579]|61)|6(?:00|16|29|3[47]|" . "4[02578]|5[0134679]|6[0235689]|7[124579])|7(?:00|19|" . "2[47]|3[034679]|4[0235689]|5[124578]|6[0134679]|" . "7[0235689]|8[124579]))|" . "8(?:0(?:4[568]|69|7[49]|8[56]|9[0479])|1(?:3[18]|4[2579]|" . "6[17]|7[1589])|2(?:1[2-4]|39|5[05]|6[037]|7[1369]|" . "8[14579]|99)|3(?:1[679]|26|39|48|5[36]|6[1478]|" . "7[0134679])|4(?:00|1[06]|2[27]|3[0367]|4[1478]|" . "5[0134679]|7[17]|8[0134679]|99)|5(?:1[258]|2[14579])|" . "6(?:05|3[0134679]|62|77|82|9[03679])|7(?:09|1[89]))|" . "9(?:0(?:40|7[3579]|81)|1(?:29|34|43|5[05]|6[058]|" . "7[134679]|8[0235689]|9[124578])|2(?:3[13]|5[07]|6[49]|" . "7[58]|8[147]|9[0134679])|3(?:12|3[15]|4[034679]|" . "5[0235689]|6[124578])|4(?:07|15|2[03689]|3[124578]|" . "4[0134679])|5(?:18|2[02]|37|4[27]|5[158]|6[1478]|84|" . "97)|6(?:0[14578]|1[0134679])))" . "|9(?:0(?:4(?:0[2389]|1[19]|2[579]|3[19]|4[139]|5[13579]|6[19]|" . "7[1358]|8[029]|91)|5(?:1[38]|22|3[07]|4[27]|5[269]|62|" . "7[149]|8[47]|9[269])|6(?:0[27]|1[034679])|76[23568])|" . "1(?:0(?:5[2468]|7[47]|8[03568]|9[0134679])|1(?:26|54|" . "6[16]|7[147]|8[03679])|2(?:07|17|2[047]|3[035689]|" . "4[124579]|57|7[58]|8[124679])|3(?:01|15|2[0257]|" . "3[02468]|4[14679]|5[0235689]|6[124579])|4(?:13|38|" . "4[38]|5[269]|6[0235689]|7[124578]|8[0134679])|5(?:22|" . "41|5[05]|6[047]|7[258]|8[03679]|9[0235689])|" . "6(?:0[124578]|1[0134679]|2[0235689]|3[124579])|" . "7(?:1[079]|2[0235689]|3[124578]|4[0134679]|57|8[158]|" . "9[0235689])|80[124579])|" . "2(?:2(?:24|37|4[259]|5[369]|6[0235689]|7[124578]|" . "8[0134679])|3(?:18|3[149]|4[258]|5[358]|6[0134679])|" . "4(?:21|3[169]|4[24579])|5(?:07|2[16]|3[369]|" . "4[0235689]|5[124579])|6(?:37|48|55|6[05]|7[06]|8[15]|" . "9[034679])|7(?:0[0235689]|1[124578]|2[0134679]))|" . "3(?:0(?:4[79]|5[13579]|7[37]|8[03679]|9[0235689])|" . "1(?:0[124579]|28|3[38]|4[29]|5[258]|6[147]|7[03679]|" . "8[0235689]|9[124579])|3(?:09|26|3[369]|4[235689]|" . "5[124689])|4(?:13|26|37|4[49]|5[358]|6[2468]|" . "7[0134679]|8[0235689]|9[124579]))|" . "4(?:0(?:3[246]|51|6[05]|7[28]|8[169]|9[49])|1(?:0[47]|" . "1[0368]|2[147]|3[03679]|4[0235689]|5[124578]|" . "6[0134679])|2(?:09|27|3[49]|4[49]|5[0235689]|" . "6[124579])|3(?:15|27|3[0369]|4[24578]|5[0134679]|" . "6[0235689]|7[124579])|4(?:05|19|2[48]|3[1679]|47|69|" . "74|8[16]|9[16])|5(?:0[158]|1[38]|2[2679]|3[0235689]|" . "4[124578]|5[0134679]|6[0235689]|7[124579]))|" . "5(?:0(?:28|3[02])|1(?:00|1[19]|26|3[18]|45|5[28]|6[38]|" . "7[369]|8[0235689]|9[124579])|2(?:13|3[34679])|3(?:26|" . "3[69]|4[69]|5[25689]|6[124579])|4(?:4[4578]|6[0369]|" . "7[38]|8[258]|9[0134679])|5(?:0[0235689]|1[124579])|" . "6(?:15|32|43|5[29]|66|7[169]|8[0235689]|9[124578])|" . "70[0134679])|" . "6(?:0(?:4[79]|5[02])|1(?:0[36]|1[047]|2[0369]|3[258]|" . "4[25689]|5[124578]|6[0134679]|7[0235689]|8[124578]|" . "9[0134679])|2(?:15|24|3[17]|4[27]|5[037]|6[0489]|" . "7[124579])|3(?:17|28|3[27]|4[269]|5[258]|6[14579])|" . "4(?:50|65|7[269]|8[24679])|5(?:15|2[348]))|" . "7(?:0(?:7[02468]|8[024])|199|2(?:0[49]|1[58]|2[258]|" . "3[024679]|4[134679]|5[0235689]|6[124578]|7[0134679]|" . "8[0235689]|9[124579])|3(?:18|20|3[247]|4[0268]|" . "5[03579])|4(?:12|2[124]|37|4[07]|5[036]|6[149]|7[58]|" . "8[368]|9[0134679])|5(?:0[0235689]|1[134679]|" . "2[0235689]|3[124579])|6(?:1[68]|3[138]|4[057]|" . "5[034679]|88)|7(?:0[258]|1[147]|2[03-579]|37|53|6[29]|" . "7[235689]|8[0235689]|9[124579])|8(?:16|28|3[34679]|" . "4[0235689]|5[124579]|77|9[26])|9(?:0[0134679]|22|" . "4[147]|5[03679]|80|9[0369]))|" . "8(?:5(?:2[7-9]|30|4[47]|5[349]|74|87|9[03679])|6(?:17|" . "3[149]|46|6[03679]|7[38]|93)|7(?:0[148]|1[146]|24|39|" . "4[3469]))|" . "9(?:0(?:8[4-79]|9[1246-9])|1(?:0[02]|30|89|9[258])|3(?:10|" . "26|3[048])|4(?:2[3578]|3[89]|4[148])|51[08]|6(?:10|" . "2[58]|3[1468])|7(?:06|1[38]|3[45]|5[259]|6[258])|" . "8(?:1[79]|26|3[0147]|4[268]|6[79]|8[057]|9[1478])|" . "9(?:47|5[58]|7[46]|8[68]|9[1468])))" . ")", # # Postal codes of Greenland use a slice of the Danish postal code system. # Greenlands postal code consist of 4 digits, the first two being 39. # Except Santas postal code. He uses 2412. # # Data from: http://download.geonames.org/export/zip/GL.zip # Greenland => "(?k:2412" . "|39(?:0[05]|1[0-359]|2[0-4]|3[02]|40|5[0-35]|6[124]|" . "7[0-2]|8[0245]|92)" . ")", # # Postal codes for Italy use 5 digits, with leading 0s. Codes starting # with 4789 belong to San Marino. # # Data from: http://download.geonames.org/export/zip/IT.zip # Italy => "(?k:0(?:0(?:0(?:1[0-357-9]|2[0-9]|3[0-9]|4[0-9]|5[0-57-9]|" . "6[0-35-9])|1(?:19|2[0-8]|3[1-9]|4[1-9]|5[1-9]|6[1-9]|" . "7[1-9]|8[1-9]|9[1-9]))|" . "1(?:0(?:1[0-24-9]|2[0-8]|3[02-9])|100)|" . "2(?:0(?:1[0-689]|2[0-68]|3[0-57-9]|4[0-9])|100)|" . "3(?:0(?:1[0-46-9]|2[0-9]|3[0-9]|4[0-9])|100)|" . "4(?:0(?:1[0-9]|2[0-9])|100)|" . "5(?:0(?:1[0-8]|2[0-689]|3[0-2459])|100)|" . "6(?:0(?:1[024689]|2[0-9]|3[013-689]|4[0-79]|5[013-79]|" . "6[0-689]|7[023]|8[1349])|1(?:00|2[1-9]|3[124]))|" . "7(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[013-9])|100)|" . "8(?:0(?:1[0-35-9]|2[0-9]|3[0-9]|4[02-9])|100)|" . "9(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-57-9]|7[0-9]|8[0-68]|" . "9[0-9])|1(?:00|2[1-9]|3[14]|70)))" . "|1(?:0(?:0(?:1[0-9]|2[02-689]|3[0-24-8]|4[0-68]|5[0-9]|6[0-9]|" . "7[0-8]|8[0-8]|9[0-589])|1(?:00|2[1-9]|3[1-9]|4[1-9]|" . "5[1-6]))|" . "1(?:0(?:1[0-8]|2[0-9])|100)|" . "2(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-68]|6[0-689]|" . "7[0-9]|8[0-47-9])|100)|" . "3(?:0(?:1[0-27-9]|2[0-8]|3[0-9]|4[013-9]|60)|100|" . "8(?:1[124-8]|2[1-5]|3[13-6]|4[13-578]|5[1-6]|6[1-8]|" . "7[1-8]|8[1-8]|9[13-9])|900)|" . "4(?:0(?:1[0-9]|2[0-6]|3[0-79]|4[0-9]|5[0-57-9])|100)|" . "5(?:0(?:1[0-9]|2[0-9]|3[0-689]|4[0-689]|5[0-9]|6[0-9]|" . "7[0-9])|100)|" . "6(?:0(?:1[0-9]|2[0-9]|3[0-689]|4[0-9])|1(?:00|2[1-9]|" . "3[1-9]|4[1-9]|5[1-9]|6[1-7]))|" . "7(?:0(?:1[0-579]|2[0-8]|3[0-57-9]|4[0-8]|5[1-8])|100)|" . "8(?:0(?:1[0-9]|2[0-7]|3[0-9])|100)|" . "9(?:0(?:1[0-8]|2[0158]|3[0-478])|1(?:00|2[1-6]|3[1-9])))" . "|2(?:0(?:0(?:1[0-9]|2[0-9]|3[027]|40|56|6[0-9]|7[078]|8[0-9]|" . "9[0-9])|1(?:2[1-9]|3[1-9]|4[1-9]|5[1-9]|6[12])|" . "8(?:1[1-6]|2[1-6]|3[1-8]|4[1-7]|5[1-7]|6[1-7]|7[1-7]|" . "8[1-6])|900)|" . "1(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|100)|" . "2(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[04-6]|6[0369]|7[0-9])|100)|" . "3(?:0(?:1[0-9]|2[0-79]|3[0-8])|100|8(?:0[124-8]|1[13-9]|" . "2[1-9]|3[1-8]|4[1-9]|5[12457]|6[124578]|7[013-9]|" . "8[013-9]|9[0-9])|900)|" . "4(?:0(?:1[0-9]|2[0-9]|3[013-9]|4[0-9]|5[0-9]|6[0-9])|" . "1(?:00|2[1-9]))|" . "5(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-589]|" . "7[0-9]|8[0-9])|1(?:00|2[1-9]|3[1-6]))|" . "6(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9])|100|8(?:1[1-8]|" . "2[1-8]|3[1-9]|4[1-9]|5[1-9]|6[1-7])|900)|" . "7(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-57-9])|100)|" . "8(?:0(?:1[0-79]|2[148]|4[0135-7]|5[03]|6[0-24-689]|" . "7[0-9])|100|8(?:0[1-5]|1[1-9]|2[1-8]|3[1-368]|4[1-5]|" . "5[1-9]|6[1-68]|7[135-79]|8[13-7]|9[13-9])|922)|" . "9(?:0(?:1[0-9]|2[0-9])|100))" . "|3(?:0(?:0(?:1[03-6]|2[0-9]|3[0-9])|1(?:00|2[1-6]|3[1-35]|" . "4[12]|7[0-5]))|" . "1(?:0(?:1[0-8]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|100)|" . "2(?:0(?:1[02-6]|2[0-26-8]|3[0-7]|4[0-7])|100)|" . "3(?:0(?:1[0135-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|7[024-9]|" . "8[0-7]|9[02457-9])|1(?:00|70))|" . "4(?:0(?:1[0-24-8]|7[0-9])|1(?:00|2[1-9]|3[1-9]|4[1-9]|51|" . "70))|" . "5(?:0(?:1[0-9]|2[0-9]|3[0-24-8]|4[0-8])|1(?:00|2[1-9]|" . "3[1-9]|4[1-3]))|" . "6(?:0(?:1[0-6]|2[0-8]|3[0-6]|4[0235-7]|5[0-7]|6[0-6]|" . "7[0-35-8])|100)|" . "7(?:0(?:1[0-9]|2[0-4689]|3[0-25689]|4[0-79]|5[0-9]|" . "6[02-46-9])|1(?:00|2[1-9]|3[1-9]|42))|" . "8(?:0(?:1[0-35-9]|2[0-9]|3[0-9]|4[0-35-9]|5[0-79]|6[0-9]|" . "7[0-9]|8[0-35-9])|100)|" . "9(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-8])|100))" . "|4(?:0(?:0(?:1[0-9]|2[0-7]|3[02-8]|4[1-3568]|5[0-79]|6[0-9])|" . "1(?:00|2[1-9]|3[1-9]|41))|" . "1(?:0(?:1[0-9]|2[0-35-9]|3[0-9]|4[02-689]|5[1-9])|100)|" . "2(?:0(?:1[0-9]|2[0-8]|3[0-579]|4[0-9])|100)|" . "3(?:0(?:1[0-57-9]|2[0-24589]|3[025-9]|4[0-57-9]|" . "5[0-35689])|1(?:00|26))|" . "4(?:0(?:1[0-24-69]|2[0-35-9]|3[03-579]|4[1-357-9])|100)|" . "5(?:0(?:1[0-2457-9]|2[0-7]|3[0-9])|100)|" . "6(?:0(?:1[0-47-9]|2[02-9]|3[0-35-79]|4[0-9])|100)|" . "7(?:0(?:1[0-9]|2[013578]|3[02459]|4[23])|1(?:00|2[12])|" . "8(?:14|2[24-6]|3[2-8]|4[1-3]|5[3-5]|6[1-7])|900)|" . "8(?:0(?:1[0-578]|2[024-7])|100))" . "|5(?:0(?:0(?:1[02-489]|2[0-35-8]|3[1-9]|41|5[0-689]|6[0-8])|" . "1(?:00|2[1-79]|3[1-79]|4[1-5]))|" . "1(?:0(?:1[0-35-9]|2[0148]|3[014-79])|100)|" . "2(?:0(?:1[014-8]|2[0-24-9]|3[0-35-8]|4[13-8])|100)|" . "3(?:0(?:1[1-9]|2[0-7]|3[014-7]|4[0-357-9])|100)|" . "4(?:0(?:1[0-6]|2[136-9]|3[358])|100)|" . "5(?:0(?:1[0-689]|2[02357]|3[0-68]|4[0-2579]|5[14]|" . "6[0-24])|100)|" . "6(?:0(?:1[0-279]|2[0-589]|3[0-8]|4[013-68])|1(?:00|" . "2[1-8]))|" . "7(?:0(?:1[467]|2[0-3578]|3[0-46-9])|1(?:00|2[1-8]))|" . "8(?:0(?:1[0-2457-9]|2[02-7]|3[1346-8]|4[02-5]|5[13-5])|" . "100)|" . "9(?:0(?:1[1356]|2[14-6])|100))" . "|6(?:0(?:0(?:1[013589]|2[0-24-7]|3[013-9]|4[01348])|1(?:00|" . "2[1-9]|31))|" . "1(?:0(?:1[0-4]|2[0-689]|3[02-47-9]|4[0-9])|100)|" . "2(?:0(?:1[0-2457-9]|2[0-24-9]|3[24-689])|100)|" . "3(?:0(?:20|31|6[1-9]|7[1-9]|8[1-8]|9[1-6])|100|8(?:1[1-6]|" . "2[1-8]|3[1-9]|4[1-8]|5[1-8])|900)|" . "4(?:0(?:1[0-68]|2[013-8]|3[0-79]|4[0-79])|100)|" . "5(?:0(?:1[0-579]|2[02-9])|1(?:00|2[1-9]|3[12]))|" . "6(?:0(?:1[0-24-9]|2[0-36]|3[0-46-8]|4[0-7]|5[0-24])|100)|" . "7(?:0(?:1[02-579]|2[0-9]|3[0-9]|4[013-9]|5[0-9]|" . "6[0-46-9])|100))" . "|7(?:0(?:0(?:1[013-9]|2[0-9]|3[2378]|4[2-4]|5[46])|1(?:00|" . "2[1-9]|31))|" . "1(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-3578])|100)|" . "2(?:0(?:1[02-9]|2[0-9])|100)|" . "3(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|100)|" . "4(?:0(?:1[0-9]|2[0-8])|100)|" . "5(?:0(?:1[0-9]|2[0-9])|100)|" . "6(?:01[1-7]|12[135]))" . "|8(?:0(?:0(?:1[0-46-9]|2[0-9]|3[0-689]|4[0-24-9]|5[013-9]|" . "6[0-35-79]|7[013-9])|1(?:00|2[1-9]|3[1-9]|4[1-7]))|" . "1(?:0(?:1[0-467]|2[0-578]|3[0-9]|4[0-4679]|5[0-9])|100)|" . "2(?:0(?:1[0135-9]|2[0-9]|3[0-46-8])|100)|" . "3(?:0(?:1[0-8]|2[0-9]|3[0-24-9]|4[0-9]|5[0-9])|100)|" . "4(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[02-9]|5[0-35-79]|6[0-25-9]|" . "7[03-9]|8[0-8]|9[0-25689])|1(?:00|2[1-9]|3[1-5]))|" . "5(?:0(?:1[0-8]|2[0-9]|3[0-9]|4[02-46-9]|5[0-9])|100)|" . "6(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|7[0-57-9]|8[0-9]|" . "9[0-7])|1(?:00|70))|" . "7(?:0(?:1[0-9]|2[0-46-9]|3[0-8]|4[0-8]|5[0-8]|6[0-24679]|" . "7[0-6])|100)|" . "8(?:0(?:2[0-245]|4[0-24-79]|5[014-6]|6[02457-9]|70)|100|" . "8(?:1[1-9]|2[1-5]|3[1-8]|4[12])|900)|" . "9(?:0(?:1[0-8]|2[0-9]|3[0-9]|4[0-9]|5[0246-8]|6[02-59])|" . "1(?:00|2[1-9]|3[1-5])|8(?:1[2-9]|2[1-4]|3[1-4]|4[1-4]|" . "5[1-3]|6[1-46-8])|900))" . "|9(?:0(?:0(?:1[0-9]|2[0-9]|3[0-9]|4[0-9])|1(?:00|2[1-9]|3[1-9]|" . "4[1-9]|51))|" . "1(?:0(?:1[0-9]|2[0-9])|100)|" . "2(?:0(?:1[0-9]|2[0-9])|100)|" . "3(?:01[0-9]|100)|" . "4(?:01[0-9]|100)|" . "5(?:0(?:1[0-9]|2[0-2457-9]|3[0-9]|4[0-9])|1(?:00|2[1-9]|" . "31))|" . "6(?:01[0-9]|100)|" . "7(?:01[0-9]|100)|" . "8(?:0(?:2[0-35-9]|3[0-9]|4[0-9]|5[013-9]|6[0-9]|7[0-9])|" . "1(?:00|2[1-9]|3[1-9]|4[1-9]|5[1-9]|6[1-8])))" . ")", # # The numbering system for postal codes of Liechtenstein is part of # the numbering system for Swiss postal codes. Four digits are used # and all postal codes in Liechtenstein start with 94, the third # digit an 8 or a 9. # # Data from: http://download.geonames.org/export/zip/LI.zip # # The file above does not include 9489 (instead, a different file # reports it to be in CH), but 9489 is the postal code for Schaan Log, # which is located in Liechtenstein. # # http://postal-codes.findthedata.com/l/57083/9489-Schaan-Log # Liechtenstein => "(?k:94(?:8[5-9]|9[0-8]))", # # https://www.post.lu/documents/10181/2314856/EptSggaCsv.csv/ # ee8fa0de-5e84-4e31-8cbd-b7b57679c21a?param=0.19755403072045696 # (http://bit.ly/1PeTVqY) # Luxembourg => "(?k:0(?:1(?:01|2[13-5]|3[12]|4[1-3]|61|7[13]|8[1-3]|9[12])|" . "2(?:02|11|31|41|51|6[23]|91)|" . "3(?:2[1-5]|32|42|6[12]|72|8[1-3]|91)|" . "4(?:0[1-3]|1[12]|2[12]|4[1-356]|5[13]|6[2-4]|7[12]|8[12]|" . "9[1-7])|" . "5(?:21|3[12]|5[1-4]|6[12]|8[1-4])|" . "6(?:1[12]|4[1-4]|6[1-4]|7[12]|9[12])|" . "7(?:2[1-3]|5[1-4]|6[13]|7[12])|" . "8(?:0[1-9]|1[1-4]|2[1-3]|3[1-4]|41|5[2-5]|61|81)|" . "9(?:0[134]|1[1-4]|2[12]|4[2-4]|5[1-4]|6[1-3]|7[1-3]|" . "8[1-3]|9[1-5]))" . "|1(?:0(?:09|1[0-9]|2[0-9]|30|50|60|90)|" . "1(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-39]|6[01])|" . "2(?:0[89]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-9]|" . "7[0-9]|8[0-3])|" . "3(?:09|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-9]|7[0-6])|" . "4(?:09|1[1-9]|2[0-9]|3[0-4]|4[589]|5[0-9]|6[0-9]|7[0-9]|" . "8[0-4]|9[09])|" . "5(?:0[89]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-2])|" . "6(?:1[013-9]|2[0-9]|3[0-9]|4[0-9]|5[0-6]|6[01]|70)|" . "7(?:09|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-3])|" . "8(?:1[1-8]|2[0-2]|3[1-9]|4[0-356]|5[0-9]|6[0-8]|7[0-3]|" . "8[0-2]|9[6-9])|" . "9(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-4]))" . "|2(?:0(?:1[0-9]|20|8[024-9]|9[013-9])|" . "1(?:1[1-9]|2[0-57-9]|3[0-57-9]|4[0-9]|5[0-9]|6[0-9]|" . "7[0-9]|8[0-4])|" . "2(?:1[0-5]|2[0-9]|3[0-4]|4[0-3]|6[1-35-9]|7[0-3])|" . "3(?:0[89]|1[0-9]|2[02-46-9]|3[0-9]|4[0-9]|5[0-9]|6[01]|70|" . "8[01])|" . "4(?:09|1[0-9]|2[02-9]|3[0-6]|4[0-9]|5[0-4])|" . "5(?:1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-7])|" . "6(?:09|1[0-79]|2[0-9]|3[0-7]|5[1-4]|6[1-9]|7[0-4]|8[01])|" . "7(?:1[1-9]|2[0-9]|3[0-46-9]|4[01]|6[1-4])|" . "8(?:50|60|8[07-9])|" . "9(?:00|1[0-689]|2[0-25689]|3[0-9]|4[0-269]|5[0-8]|" . "6[014-68]|7[14-9]|8[0-8]|9[0-24-9]))" . "|3(?:2(?:0[15689]|1[0-9]|2[0-59]|3[0-9]|4[0-39]|5[0-9]|" . "6[015-79]|7[0-9]|8[0-8]|90)|" . "3(?:1[13-8]|2[0-9]|3[02-7]|4[015-9]|5[0-9]|6[0-9]|7[0-8]|" . "8[02-69]|9[0-8])|" . "4(?:0[1-39]|1[0-9]|2[0-9]|3[0-3569]|4[0-9]|5[0-4]|6[0-9]|" . "7[0-6]|8[0-9]|9[0-3])|" . "5(?:0[1-9]|1[0-7]|2[0-69]|3[0-29]|4[0-9]|5[0-5]|6[0-9]|" . "7[0-6]|8[2-589]|9[0-8])|" . "6(?:01|1[1-7]|2[0-2]|3[015-8]|4[0-4]|5[0-8]|60|7[0-9]|" . "8[0-2])|" . "7(?:0[15]|1[0-9]|2[0-9]|3[013-9]|4[0-4]|5[0-5]|6[1-8]|" . "7[0-6]|8[0-246-9]|90)|" . "8(?:01|1[0-9]|2[0-6]|3[0-9]|4[0-4]|5[0-9]|6[0-4]|7[0-9]|" . "8[0-4]|9[5-9])|" . "9(?:0[19]|1[0-9]|2[0-9]|3[0-9]|4[013-5]|6[01]|8[05]))" . "|4(?:0(?:0[1-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-9]|" . "7[0-4]|8[0-68])|" . "1(?:0[0-35-9]|1[0-689]|2[0-356]|3[0-9]|4[0-39]|5[0-6]|" . "6[4-9]|7[0-9]|80)|" . "2(?:0[1-9]|1[013467]|2[0-2]|3[0-9]|4[0-9]|5[0-6]|6[0-8]|" . "7[0-25-9]|8[0-39])|" . "3(?:0[1-9]|1[04-9]|2[0-8]|3[0-7]|4[0-9]|5[0-5]|6[0-9]|" . "7[0-3]|8[0-5]|9[0-8])|" . "4(?:0[125-9]|1[0-9]|2[0-39]|3[0-9]|4[0-9]|5[019]|6[0-9]|" . "7[05-9]|8[0-9]|9[0-49])|" . "5(?:0[1-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-59]|" . "7[0-9]|8[0-3]|9[0-9])|" . "6(?:0[1-9]|1[0-3]|2[0-9]|3[0-689]|4[0-9]|5[0136-8]|6[0-9]|" . "7[0-26-9]|8[0-9]|9[0-36-8])|" . "7(?:0[126-9]|1[0-9]|2[0-2]|3[0-9]|4[0-5]|5[0-9]|6[0-3]|" . "7[0-9]|8[0-6]|9[5-8])|" . "8(?:0[124-9]|1[0-589]|2[02-69]|3[0-47-9]|4[02-9]|5[03]|" . "7[0-9]|8[0-9]|9[0-5])|" . "9(?:0[126-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-689]|6[0-9]|" . "7[0-9]|8[0-24-9]|9[0-9]))" . "|5(?:2(?:01|1[1-9]|2[0-2]|3[0-9]|4[0134]|5[0-6]|80|9[09])|" . "3(?:1[024-8]|2[02468]|3[0-79]|4[0-2]|5[1-359]|6[0-9]|" . "7[0-8]|80)|" . "4(?:0[1-578]|1[0-9]|2[1-79]|3[0-59]|4[0-7]|5[01]|6[056]|" . "7[01]|8[0-3589]|9[59])|" . "5(?:0[15-7]|1[1-9]|2[0-3]|3[0-9]|4[0489]|5[0-9]|6[01]|" . "7[0-7])|" . "6(?:0[125]|1[0-9]|2[06-9]|3[0-9]|40|5[0-9]|7[015]|8[0-7]|" . "9[0-358])|" . "7(?:01|1[0-46-9]|2[0-3]|30|4[01]|5[0-6]|6[0-2]|7[0-6])|" . "8(?:0[189]|1[0-9]|2[0-689]|3[0-9]|4[0-46]|5[02-69]|6[0-9]|" . "7[0-68]|8[04-9]|9[0-389])|" . "9(?:4[0-3]|5[0-9]|6[0-49]|7[0-8]))" . "|6(?:1(?:01|1[1-9]|2[0-59]|3[0-9]|4[0-9]|5[05]|6[0-3569]|" . "7[015]|8[0-9]|9[05-7])|" . "2(?:01|1[0-5]|25|3[01589]|4[0356]|5[0-25])|" . "3(?:01|1[0-5]|40|50|60|70|80)|" . "4(?:0[12689]|1[0-9]|2[0-3]|3[0-9]|4[0-35-9]|5[0-5]|6[0-9]|" . "7[0-9]|8[0-8]|9[0-79])|" . "5(?:5[0-357-9]|6[02]|7[0-29]|8[0-35-7]|90)|" . "6(?:01|1[0-9]|2[0-3]|3[0-8]|4[5-9]|5[01]|6[013569]|7[0-8]|" . "8[0-9]|9[0-35])|" . "7(?:01|1[1-9]|2[0-6]|3[0-9]|4[0-5]|5[0-9]|6[0-5]|7[0-9]|" . "8[0-6]|9[0-6])|" . "8(?:15|3[0-9]|4[0-2]|5[0-28]|6[89]|7[01]|80)|" . "9(?:0[156]|1[0-9]|2[1-356]|3[01349]|4[0-8]|5[0156]|" . "6[0-29]|7[0-9]|8[0-25-9]|9[0-25-9]))" . "|7(?:2(?:0[129]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-489]|" . "7[04])|" . "3(?:0[2-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-4]|" . "7[0-9]|8[0-4]|9[0-25-7])|" . "4(?:09|1[0-25-8]|2[013-5]|3[0-35]|4[0-9]|5[0-8]|6[0-5]|" . "7[0135]|8[0-2])|" . "5(?:0[125-8]|1[1-9]|2[0-6]|3[1-9]|4[0-7]|5[3-9]|6[0-9]|" . "7[0-2]|9[0-9])|" . "6(?:01|1[023589]|2[0-7]|3[3-69]|4[019]|5[0-3]|6[0-4]|" . "7[03]|8[01])|" . "7(?:0[13]|1[0-6]|2[0-467]|3[0-57-9]|4[01]|5[089]|6[0-9]|" . "7[0-47-9]|8[0-9]|9[0-5]))" . "|8(?:0(?:0[125-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]|6[0-9]|" . "7[0-9]|8[0-9]|9[0-9])|" . "1(?:1[0-25-9]|2[013-9]|3[0-57-9]|4[0-25-79]|5[0-46-9]|" . "6[05-7]|79|8[0-9]|9[01])|" . "2(?:0[159]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-589]|6[0-9]|" . "7[0-47-9]|8[0-9]|9[0-5])|" . "3(?:0[1-3689]|1[0-9]|2[0-9]|3[0-9]|4[0-5]|5[0-9]|6[0-9]|" . "7[0-689]|8[013-8]|9[0-689])|" . "4(?:01|1[0-5]|2[0-4]|3[5-8]|4[0-57-9]|5[0-3]|6[0-9]|" . "7[0-9]|80)|" . "5(?:0[126-9]|1[01]|2[1-35-9]|3[0137-9]|4[0-6]|5[0-278]|" . "6[0-2])|" . "6(?:0[69]|1[0-5]|20)|" . "7(?:0[15-8]|1[015]|20)|" . "8(?:0[125689]|1[1-46-9]|2[0-6]|3[1-58]))" . "|9(?:0(?:0[1-46]|1[0-9]|2[0-9]|3[0-3]|4[0-8]|5[0-6]|6[0-9]|" . "7[0-2]|8[0-9]|9[0-489])|" . "1(?:1[5-9]|2[0-9]|3[0-7]|4[024-7]|5[013-8]|6[013-9]|" . "7[0-35-79]|8[0-4689]|9[01])|" . "2(?:0[1-9]|1[0-8]|2[014-9]|3[0-9]|4[0-59]|5[0-9]|6[0-8]|" . "7[35-9]|8[0-9]|9[0-4])|" . "3(?:30|40|5[0-79]|6[014-689]|7[0-35-8]|8[0-2]|9[0-25])|" . "4(?:0[15-9]|1[0-24-9]|2[0-6]|40|5[1-9]|6[1-6])|" . "5(?:0[126]|1[0-9]|2[0-3]|3[0-9]|4[0-5]|5[0-9]|60|7[0-9])|" . "6(?:3[1-35-9]|4[013-578]|5[013-79]|6[0235689]|7[0-468]|" . "8[12479]|9[06])|" . "7(?:0[16-9]|1[0-5]|3[78]|4[0-9]|5[1-9]|6[0-9]|7[0-69]|80)|" . "8(?:0[15-9]|3[013-9]|4[01])|" . "9(?:0[1-35-9]|1[0-3]|4[02-468]|5[0246]|6[02468]|7[0246]|" . "8[02]|9[0-39]))" . ")", # # Postal codes of Monaco are part of the system used for France. # Monaco uses postal codes starting with 980. 98000 is for all # physical addresses, while numbers ending in 01 - 99 are reserved # for special deliveries. # # http://www.upu.int/fileadmin/documentsFiles/activities/ # addressingUnit/mcoEn.pdf # Monaco => "(?k:980[0-9][0-9])", # # Postal codes in Norway use 4 digits. Leading 0s happen, but not all # combinations are used. # # Data from: http://download.geonames.org/export/zip/GL.zip # Norway => "(?k:0(?:0(?:01|1[058]|2[14-68]|3[0-47]|4[05-8]|5[015]|60|80)|" . "1(?:0[1-79]|1[0-9]|2[0-589]|3[0-9]|5[0-57-9]|6[0-24-9]|" . "7[0-9]|8[0-8]|9[0-68])|" . "2(?:0[1-478]|1[1-8]|30|4[047]|5[0-9]|6[02-8]|7[0-9]|" . "8[0-467])|" . "3(?:0[1-9]|1[13-9]|23|30|4[09]|5[0-9]|6[0-9]|7[0-9]|" . "8[0-3])|" . "4(?:0[1-689]|1[0-35]|2[1-4]|4[0-25]|5[0-24-9]|6[0-57-9]|" . "7[02-9]|8[0-9]|9[0-6])|" . "5(?:0[1-9]|1[0-35-8]|20|40|5[0-9]|6[0-9]|7[0-9]|8[0-9]|" . "9[0-8])|" . "6(?:0[1-9]|1[1-9]|2[0-46]|5[0-9]|6[0-9]|7[0-9]|8[0-9]|" . "9[0-4])|" . "7(?:0[125]|1[02]|5[0-8]|6[03-8]|7[0-9]|8[1-9]|9[01])|" . "8(?:0[15-7]|40|5[0-8]|6[0-4]|7[0-7]|8[0-4]|9[01])|" . "9(?:0[1-578]|1[3-5]|5[0-9]|6[02-489]|7[0-35-9]|8[0-8]))" . "|1(?:0(?:0[135-9]|11|5[1-6]|6[1-57-9]|71|8[1346-9])|" . "1(?:0[129]|12|5[0-8]|6[0-9]|7[026-9]|8[12457-9])|" . "2(?:0[1-57]|1[45]|5[0-9]|6[236]|7[0-589]|8[13-6]|9[0145])|" . "3(?:0[0-79]|1[1-46-9]|2[1-9]|3[0-9]|4[0-24689]|5[0-46-9]|" . "6[0-9]|7[1-35-9]|8[013-9]|9[0-79])|" . "4(?:0[0-9]|1[0-9]|2[019]|3[0-2]|4[0-9]|5[013-578]|6[89]|" . "7[0-9]|8[0-8])|" . "5(?:0[1-4689]|1[0-9]|2[0-689]|3[0-9]|4[015]|5[056]|60|70|" . "8[01]|9[0-36-9])|" . "6(?:0[1-9]|1[02-9]|2[014-689]|3[02-46-9]|4[0-2]|" . "5[013-57-9]|6[1-7]|7[0-35689]|8[02-4]|9[02])|" . "7(?:0[1-9]|1[0-589]|2[0-7]|3[03-589]|4[0235-7]|5[1-479]|" . "6[013-9]|7[126-9]|8[1-9]|9[0-4689])|" . "8(?:0[1-9]|1[1-6]|2[0357]|3[0-3]|5[019]|6[0167]|7[0158]|" . "80|9[0-3])|" . "9(?:0[013]|1[0-2467]|2[013-9]|3[01]|4[01]|5[04]|6[013]|" . "7[01]))" . "|2(?:0(?:0[013-9]|1[0-9]|2[0-8]|3[0-6]|4[01]|5[0-8]|6[0-26-9]|" . "7[0-46]|8[01]|9[0-3])|" . "1(?:0[01]|1[046]|2[03]|3[034]|5[01]|6[0-24-6]|70)|" . "2(?:0[1-689]|1[0-46-9]|2[03-6]|3[0235]|40|56|6[014-6]|" . "7[01]|8[03])|" . "3(?:0[1-9]|1[25-9]|2[0-6]|3[024-8]|4[0145]|5[035]|6[045]|" . "72|8[0-9]|9[01])|" . "4(?:0[1-35-9]|1[0-2568]|2[0-357-9]|3[025-8]|4[0368]|5[01]|" . "60|7[6-8]|8[015])|" . "5(?:0[01]|1[02]|4[024]|5[025]|6[01]|8[0-24])|" . "6(?:0[1-9]|1[0-9]|2[4-69]|3[0-79]|4[0235-9]|5[1-36-9]|" . "6[0-9]|7[02-7]|8[02-8]|9[03-5])|" . "7(?:1[1-8]|20|30|4[023]|50|60|70)|" . "8(?:0[1-9]|1[015-9]|2[0-257]|3[0-26-9]|4[036-9]|5[013478]|" . "6[0-2467]|7[09]|8[0-2]|9[03])|" . "9(?:0[017]|1[078]|2[039]|3[03679]|4[03]|5[02-49]|6[067]|" . "7[3-57]|85))" . "|3(?:0(?:0[1-9]|1[1-9]|2[1-9]|3[0-9]|4[0-8]|5[013-8]|6[01]|" . "7[015]|8[0-9]|9[025])|" . "1(?:0[13-9]|1[0-9]|2[0-8]|3[1-357-9]|4[0-58]|5[0-47-9]|" . "6[0-9]|7[0-9]|8[0-9]|9[1-69])|" . "2(?:0[1-9]|1[0-9]|2[0-9]|3[0-9]|4[0-69]|5[1-9]|6[0-57-9]|" . "7[014-7]|8[0-245]|9[0-24-7])|" . "3(?:0[01]|2[0-2]|3[01]|4[0-2]|5[01589]|6[01]|7[01])|" . "4(?:0[1-9]|1[0-4]|2[015-8]|3[01]|4[0-2]|7[0-24-8]|8[0-4]|" . "9[01])|" . "5(?:0[1-47]|1[0-9]|2[0-689]|3[013-9]|4[014]|5[01]|6[01]|" . "7[015-79]|8[018]|9[35])|" . "6(?:0[1-689]|1[0-9]|2[0-46-9]|3[0-2]|4[6-8]|5[0268]|" . "6[0156]|7[1-9]|8[0134]|9[0-27])|" . "7(?:0[1-578]|1[0-9]|2[0-9]|3[0-9]|4[0-46-9]|5[03]|6[06]|" . "70|8[01357-9]|9[0-68])|" . "8(?:0[0-5]|1[0-2]|2[05]|3[0-6]|4[01489]|5[03-5]|64|70|" . "8[02-8]|9[0135])|" . "9(?:0[1-6]|1[0-9]|2[0-24589]|3[013679]|4[0-46-9]|50|" . "6[05-7]|70|9[13-9]))" . "|4(?:0(?:0[1-9]|1[0-9]|2[0-9]|3[1-6]|4[1-9]|5[0-9]|6[4-9]|" . "7[06-9]|8[1-9]|9[0-9])|" . "1(?:0[02]|1[09]|2[0346-9]|3[0479]|4[68]|5[02-4689]|" . "6[01347-9]|7[034]|8[027]|98)|" . "2(?:0[0189]|3[03-579]|4[04]|50|6[0245]|7[024-6]|80|" . "9[14-9])|" . "3(?:0[1-9]|1[0-9]|2[1-9]|3[02359]|4[0-9]|5[2-8]|" . "6[02-57-9]|7[0-689]|8[0179]|9[1-8])|" . "4(?:0[0-3]|20|3[2468]|4[013]|6[0235]|73|8[045]|9[0-2])|" . "5(?:0[1-69]|1[3-79]|2[0-589]|3[246]|4[04]|5[0-478]|6[03]|" . "7[5-79]|8[068]|9[056])|" . "6(?:0[4-689]|1[0-9]|2[0-689]|3[0-9]|4[05-7]|5[16-9]|" . "6[1-6]|7[0-9]|8[1-9]|9[13-9])|" . "7(?:0[0-35]|15|2[04]|3[03-57]|4[12578]|5[4-6]|6[068]|70|" . "80|9[0-5])|" . "8(?:0[1-489]|1[025-8]|2[013-578]|3[024689]|4[1-46-9]|" . "5[1-9]|6[1-589]|7[06-9]|8[4-9]|9[1-468])|" . "9(?:0[0-29]|1[0256]|20|34|5[0-35]|7[1-4]|8[05]|9[034]))" . "|5(?:0(?:0[3-9]|1[0-9]|2[0-2]|3[1-9]|4[1-35]|5[2-9]|6[378]|" . "7[235]|8[129]|9[346-9])|" . "1(?:0[14-9]|1[13-9]|2[124]|3[0-24-7]|4[1-8]|5[1-5]|6[0-5]|" . "7[0-46-9]|8[34])|" . "2(?:0[0-36-9]|1[0-25-8]|2[1-9]|3[0-25-9]|4[34]|5[1-47-9]|" . "6[0-578]|8[1-6]|9[139])|" . "3(?:0[0-9]|1[04589]|2[1-35-79]|3[13-7]|4[1-35-7]|" . "5[03-578]|6[0356]|7[1489]|8[0-24578]|9[2-46-9])|" . "4(?:0[1-46-9]|1[0-9]|2[0378]|3[07]|4[03-579]|5[0-57-9]|" . "6[02-5]|7[02-6]|8[046]|9[89])|" . "5(?:0[1-9]|1[124-9]|2[1-357-9]|3[1-8]|4[124-9]|5[01459]|" . "6[0135-8]|7[04-68]|8[02-689]|9[013-68])|" . "6(?:0[0-245]|1[024]|2[06-9]|3[025-7]|4[0-35-79]|5[023]|" . "8[0357]|9[03-6])|" . "7(?:0[0-9]|1[0-589]|2[1-9]|3[01346]|4[1-35-9]|5[0-2]|" . "6[03]|7[036-9]|8[0-8])|" . "8(?:0[3-9]|1[0-9]|2[0-24589]|3[1568]|4[157-9]|5[1-47-9]|" . "6[1-489]|7[1-36-9]|8[1246-9]|9[23569])|" . "9(?:0[2-46-8]|1[1-8]|3[16-9]|4[1378]|5[1-7]|6[0-267]|" . "7[07-9]|8[13467]|9[134]))" . "|6(?:0(?:0[1-9]|1[0-9]|2[0-68]|3[05-9]|4[03-8]|5[0-257-9]|" . "6[02-57-9]|7[06]|8[02-579]|9[0-24-689])|" . "1(?:0[0-6]|10|20|3[39]|4[0-469]|5[0-6]|6[0156]|7[04]|" . "8[34]|9[06])|" . "2(?:0[01]|1[0-68]|2[024]|3[089]|4[09]|5[09]|6[03-5]|7[02]|" . "8[0-35]|9[02-4])|" . "3(?:0[01]|1[05]|20|3[09]|50|6[034]|8[67]|9[0-9])|" . "4(?:0[1-57-9]|1[0-689]|2[1-359]|3[013-6]|4[03-57]|5[03-7]|" . "6[0-2]|7[0256]|8[01346-8]|9[0349])|" . "5(?:0[1-46-9]|1[0-24-8]|2[0-59]|3[089]|7[01]|90)|" . "6(?:0[01]|1[0-3]|2[0289]|3[0136-9]|4[02-5]|5[0235-9]|" . "7[04]|8[036-9]|9[0347-9])|" . "7(?:0[0-478]|1[013-9]|2[136-9]|3[0147]|4[01]|5[01]|6[13]|" . "7[0-26-9]|8[1-489]|9[1-35-9])|" . "8(?:0[0-9]|1[0-57-9]|2[1-36-9]|4[1378]|5[1-689]|6[13689]|" . "7[0-35-9]|8[124-8]|9[13-689])|" . "9(?:0[0-39]|1[24-9]|2[146-9]|4[0-2467]|5[1378]|6[1346-9]|" . "7[13578]|8[0-8]|9[1356]))" . "|7(?:0(?:0[3-6]|1[0-689]|2[0-9]|3[0-46-9]|4[0-9]|5[0-46-9]|" . "7[024589]|8[0-389]|9[127-9])|" . "1(?:0[015]|1[02-49]|2[015-79]|30|4[02]|5[02369]|6[05-9]|" . "7[06-8]|80|9[04])|" . "2(?:0[0136]|1[1-3]|2[13478]|3[124-689]|4[0-367]|5[025-79]|" . "6[013468]|7[03]|8[024-9]|9[0158])|" . "3(?:0[0-2]|1[05689]|2[0179]|3[1-68]|4[0-35]|5[013-578]|61|" . "7[024]|8[03467]|9[1-37-9])|" . "4(?:0[0-9]|1[0-9]|2[0-24-9]|3[0-9]|4[0-9]|5[0-9]|" . "6[1-35-9]|7[0-9]|8[0-9]|9[0-7])|" . "5(?:0[0-9]|1[02-479]|2[059]|3[013]|4[019]|5[01]|6[0236]|" . "70|8[0134]|9[016])|" . "6(?:0[0-9]|1[09]|2[02-49]|3[0-4]|5[0-8]|60|7[01]|90)|" . "7(?:0[1-57-9]|1[0-8]|2[4-69]|3[024-9]|4[024-68]|5[01]|" . "6[01]|7[017]|9[0167])|" . "8(?:0[0-58]|1[07-9]|2[02]|56|6[0349]|7[013]|8[24]|" . "9[02368])|" . "9(?:0[01]|4[04]|50|60|7[01367]|8[0-25]|9[034]))" . "|8(?:0(?:0[1-9]|1[0-69]|2[0-36-9]|3[0-278]|4[17-9]|5[068]|" . "6[34]|7[0-69]|8[46-9]|9[1-8])|" . "1(?:0[0238]|1[048]|2[08]|3[0568]|4[0569]|5[017-9]|6[018]|" . "7[08]|8[124-9]|9[035-8])|" . "2(?:0[0-35-9]|1[014589]|2[06]|3[0-3]|5[0156]|6[0146]|" . "7[013-68]|8[135689]|9[01478])|" . "3(?:0[0159]|1[0-7]|2[02-68]|40|5[27]|60|7[0236-8]|" . "8[02478]|9[0238])|" . "4(?:0[0-9]|1[0-6]|2[68]|3[0289]|4[57]|5[059]|6[59]|7[05]|" . "8[013-589]|93)|" . "5(?:0[1-9]|1[02-8]|2[023]|3[013-69]|4[036]|9[01])|" . "6(?:0[1-478]|1[03-8]|2[246]|3[048]|4[0-36-8]|5[124-9]|" . "6[013-6]|72|8[01]|9[01])|" . "7(?:0[01]|2[03-5]|3[0235]|4[023]|5[02-4]|6[12467]|70)|" . "8(?:0[0-59]|13|2[07]|30|4[24]|5[0-24]|6[015]|70|80|" . "9[0-27])|" . "9(?:0[0-24-9]|10|2[0-2]|6[01]|76|8[015]))" . "|9(?:0(?:0[6-9]|1[0-9]|2[02479]|3[0478]|4[02369]|5[05-79]|" . "6[02489])|" . "1(?:0[0-8]|1[089]|2[08]|3[0-24-8]|4[0-46-8]|5[1-369]|" . "6[1-39]|8[0-24-79]|9[02-57])|" . "2(?:40|5[1-9]|6[0-35-9]|7[0-9]|8[0-8]|9[0-4689])|" . "3(?:0[02-6]|1[0156]|2[12569]|3[4-6]|5[0578]|6[05]|" . "7[02369]|8[0-24-9]|9[1-35])|" . "4(?:0[2-9]|1[1459]|2[03-7]|3[069]|4[0-8]|5[013-5]|" . "7[01569]|8[0-9]|9[6-8])|" . "5(?:0[1-9]|1[0-9]|2[015]|3[1-36]|4[05]|5[01]|8[02-7]|" . "9[035])|" . "6(?:0[09]|1[056]|2[014]|5[07]|64|7[02]|9[0-2])|" . "7(?:0[09]|1[0-7]|22|3[05]|4[02]|5[01]|6[03-58]|7[0-35]|82|" . "90)|" . "8(?:0[02]|1[015]|2[06]|4[056])|" . "9(?:00|1[024-7]|25|3[05]|5[01]|60|8[0-2]|9[01]))" . ")", # # San Marino uses a slice of the postal codes for Italy. # Any postal code starting with 4789, followed by another # digit is from San Marino # # Data: http://download.geonames.org/export/zip/SM.zip # 'San Marino' => "(?k:4789[0-9])", Spain => "(?k:(?k:0[1-9]|[1-4][0-9]|5[0-2])(?k:[0-9])(?k:[0-9]{2}))", # Five digits, first two indicate the province. # Third digit: large town, main delivery rounds. # Last 2 digits: delivery area, secondary delivery route # or link to rural areas. # # Switzerland uses four digit postal codes; leading 0s are not used. # Not every combination is in use. Postal codes starting with 948 and # 949 are used by Liechtenstein, and will not be recognized by the # pattern below. # # Data from: http://download.geonames.org/export/zip/CH.zip # Switzerland => "(?k:1(?:0(?:0[0-9]|1[0-2457-9]|2[02-9]|3[0-9]|4[0-7]|5[2-589]|" . "6[1-368]|7[0-36-8]|8[0-58]|9[0-8])|" . "1(?:1[02-7]|2[1-8]|3[124-6]|4[1-9]|6[2-9]|7[02-6]|8[02-9]|" . "9[5-7])|" . "2(?:0[0-9]|1[1-9]|2[02-8]|3[1-4679]|4[0-8]|5[1-8]|6[0-9]|" . "7[0-9]|8[13-9]|9[0-9])|" . "3(?:0[02-8]|1[0-35-8]|2[0-69]|3[078]|4[1-8]|5[02-8]|" . "7[2-7])|" . "4(?:0[014-9]|1[0235-8]|2[0-9]|3[0-9]|4[0-356]|5[02-4]|" . "6[2-48]|7[03-5]|8[2-69])|" . "5(?:09|1[02-5]|2[1-9]|3[02-8]|4[1-5]|5[1-5]|6[2-8]|" . "8[02-9]|95)|" . "6(?:0[7-9]|1[0-9]|2[3-8]|3[0-8]|4[2-9]|5[1-46-9]|" . "6[0135-79]|7[03-9]|8[0-9]|9[0-24-79])|" . "7(?:0[0-2457-9]|1[2-9]|2[0-8]|3[0-8]|4[0-24-9]|5[2-467]|" . "6[23]|7[2-6]|8[2-9]|9[1-7])|" . "8(?:0[0-9]|1[14-8]|2[02-4]|3[23]|4[4-7]|5[2-46]|6[02-9]|" . "7[0-5]|8[0245]|9[0-35-9])|" . "9(?:0[2-8]|1[1-489]|2[0-35-9]|3[2-46-8]|4[1-8]|5[013578]|" . "6[1-9]|7[1-8]|8[1-8]|9[1-467]))" . "|2(?:0(?:0[0-46-9]|1[02-79]|2[2-578]|3[4-7]|4[236]|5[2-46-8]|" . "6[3578]|7[2-5]|8[78])|" . "1(?:0[358]|1[2-7]|2[3467]|49)|" . "20[6-8]|3(?:0[0-46]|1[468]|2[25]|3[368]|4[05]|5[034]|" . "6[02-4])|" . "4(?:0[056]|1[46])|" . "5(?:0[0-5]|1[02-8]|2[035]|3[2-8]|4[02-5]|5[2-8]|6[02-5]|" . "7[25-7])|" . "6(?:0[3-8]|1[02356])|" . "7(?:1[02-8]|2[023]|3[23568]|4[02-8]|62)|" . "8(?:0[0235-7]|1[2-4]|2[2-9]|3[02]|4[23]|5[2-7]|6[34]|73|" . "8[2-9])|" . "9(?:0[02-8]|1[24-6]|2[2-6]|3[235]|4[2-467]|5[02-4]))" . "|3(?:0(?:0[0-8]|1[0-57-9]|2[0479]|3[02-9]|4[0-9]|5[02-4]|" . "6[35-8]|7[0-8]|8[2-9]|9[5-9])|" . "1(?:1[0-6]|2[2-8]|32|4[4578]|5[02-9]|7[2-9]|8[2-6])|" . "2(?:0[2-8]|1[02-6]|2[56]|3[2-8]|5[0-7]|6[2-46-8]|7[0-4]|" . "8[02-6]|9[2-8])|" . "3(?:0[235-9]|1[2-57]|2[1-6]|6[0235-8]|7[2-7]|80)|" . "4(?:0[0-2]|1[2-9]|2[1-9]|3[2-9]|5[2-7]|6[2-5]|7[2-6])|" . "5(?:0[346-8]|1[023]|3[1-8]|43|5[0-35-7])|" . "6(?:0[0-57-9]|1[2-9]|2[2-9]|3[1-68]|4[5-7]|5[2-8]|6[1-5]|" . "7[1-4])|" . "7(?:0[02-7]|1[13-8]|2[2-5]|5[2-8]|6[2-6]|7[0-35-8]|8[0-5]|" . "92)|" . "8(?:0[013-7]|1[2-68]|2[2-6]|5[2-8]|6[02-4])|" . "9(?:0[0-8]|1[0-46-9]|2[02-9]|3[0-57-9]|4[02-9]|5[1-7]|" . "6[0135-8]|7[0-9]|8[2-9]|9[1-9]))" . "|4(?:0(?:0[0-57-9]|1[0-35-9]|2[03-5]|3[0-59]|4[0-2]|5[1-9]|65|" . "7[058]|8[0-9]|9[1-6])|" . "1(?:0[1-8]|1[24-8]|2[3-7]|3[23]|4[2-8]|53)|" . "2(?:0[2-46-8]|2[2-9]|3[2-4]|4[2-7]|5[2-4])|" . "3(?:0[2-5]|1[02-7]|2[2-5]|3[2-4])|" . "4(?:02|1[0-9]|2[1-6]|3[1-8]|4[1-8]|5[0-35-8]|6[0-9]|" . "9[2-7])|" . "5(?:0[0-39]|1[2-5]|2[2-58]|3[2-9]|4[23]|5[1-46-8]|6[2-6]|" . "7[1346-9]|8[1-8])|" . "6(?:0[0139]|1[1-8]|2[0-689]|3[02-4]|40|5[2-8]|6[35])|" . "7(?:0[2-4]|1[02-9])|" . "8(?:0[0-35-9]|1[2-4]|5[236])|" . "9(?:0[0-2]|1[1-79]|2[2-4]|3[2-8]|4[2-4]|5[02-5]))" . "|5(?:0(?:0[014]|1[02-578]|2[2-8]|3[2-7]|4[02-46]|5[346-8]|" . "6[2-4]|7[02-9]|8[02-5])|" . "1(?:0[235-8]|1[236])|" . "2(?:0[01]|1[023]|2[2-5]|3[2-7]|4[2-6]|7[2-7])|" . "3(?:0[013-6]|1[2-8]|2[2-6]|3[02-4])|" . "4(?:0[0-24-68]|1[235-7]|2[0356]|3[0-26]|4[2-5]|5[2-4]|" . "6[2-7])|" . "5(?:0[2-7]|12|2[245])|" . "6(?:0[013-8]|1[0-9]|2[0-8]|3[02467]|4[2-7])|" . "7(?:0[2-8]|12|2[2-8]|3[2-7]|4[256]))" . "|6(?:0(?:0[02-9]|1[0-9]|2[0-8]|3[0-9]|4[2-578]|5[2356]|" . "6[0-46-8]|7[2-48]|8[3-6])|" . "1(?:0[2356]|1[02-4]|2[2356]|3[023]|4[2-7]|5[2-46]|" . "6[0-367]|7[034]|82|9[267])|" . "2(?:0[3-8]|1[0-8]|2[12]|3[1-6]|4[2-8]|5[23]|6[02-5]|" . "7[4-7]|8[013-9]|9[45])|" . "3(?:0[0-4]|1[02-57-9]|3[0-3]|4[0-69]|5[346]|6[235]|7[0-7]|" . "8[236-8]|9[01])|" . "4(?:0[2-5]|1[04-8]|2[2-4]|3[0-468]|4[0-3]|5[24]|6[0-9]|" . "7[2-6]|8[2457]|9[013])|" . "5(?:0[0136]|1[1-8]|2[3-8]|3[2-578]|4[0-9]|5[6-8]|6[235]|" . "7[1-9]|8[2-4]|9[02-9])|" . "6(?:0[0-245]|1[1-468]|22|3[1-7]|4[4-8]|5[2-9]|6[1-4]|" . "7[02-8]|8[2-5]|9[02-6])|" . "7(?:0[2357]|1[03-9]|2[0-4]|4[2-9]|6[034]|7[2-7]|8[01])|" . "8(?:0[2-9]|1[04-8]|2[1-35-8]|3[02-9]|5[02-5]|6[2-7]|" . "7[2-57]|83)|" . "9(?:0[0-8]|1[1-9]|2[124-9]|3[02-9]|4[2-9]|5[0-9]|6[2-8]|" . "7[46-9]|8[0-46-9]|9[0-9]))" . "|7(?:0(?:0[0-467]|1[2-9]|2[36-9]|3[12]|5[06-8]|6[2-4]|7[4-8]|" . "8[2-4])|" . "1(?:0[4679]|1[0-6]|2[26-8]|3[02-8]|4[1-9]|5[1-9]|6[2-8]|" . "7[2-6]|8[02-9])|" . "2(?:0[1-68]|1[2-5]|2[02-468]|3[1-35]|4[0-79]|5[02]|6[05]|" . "7[026-8])|" . "3(?:0[2-467]|1[02-57]|2[03-6])|" . "4(?:0[2-578]|1[1-9]|2[1-8]|3[0-8]|4[02-8]|5[0-9]|6[02-4]|" . "7[237]|8[24]|9[2-4])|" . "5(?:0[02-5]|1[2-7]|2[2-7]|3[02-7]|4[2356]|5[0-46-9]|" . "6[023])|" . "6(?:0[2-68]|10)|" . "7(?:10|4[1-8]))" . "|8(?:0(?:0[0-68]|1[0-256]|2[0-467]|3[0-46-9]|4[0-24-9]|" . "5[0-357-9]|6[013-68]|7[0145]|8[015-8]|9[0-3689])|" . "1(?:0[2-9]|1[2-578]|2[1-7]|3[02-6]|4[23]|5[2-8]|6[24-6]|" . "7[2-5]|8[0-57]|9[2-7])|" . "2(?:0[0-578]|1[02-9]|2[2-68]|3[1-689]|4[0-35-8]|5[2-59]|" . "6[0-9]|7[2-4]|8[05])|" . "3(?:0[1-9]|1[0-2457]|2[025]|3[0-25]|4[02-5]|5[2-7]|6[023]|" . "7[0-246])|" . "4(?:0[0-24-689]|1[0-68]|2[1-8]|4[247]|5[0-57-9]|6[0-8]|" . "7[124-9]|8[2-46-9]|9[2-9])|" . "5(?:0[0-35-8]|1[024]|2[02-6]|3[025-7]|4[02-8]|5[2-68]|" . "6[014-6]|7[02-7]|8[0-9]|9[02-9])|" . "6(?:0[02-8]|1[02-8]|2[0-7]|3[02-9]|4[056])|" . "7(?:0[02-46-8]|1[2-8]|2[235-7]|3[02-57-9]|40|5[0-9]|" . "6[25-7]|7[2-57]|8[2-4])|" . "8(?:0[0-8]|1[02356]|2[045]|3[2-6]|4[0-79]|5[2-8]|6[2-8]|" . "7[2-47-9]|8[0-9]|9[02-8])|" . "9(?:0[1-9]|1[0-9]|2[56]|3[2-4]|42|5[1-7]|6[24-7]|70))" . "|9(?:0(?:0[0146-9]|1[0-6]|2[02-9]|3[02-8]|4[2-4]|5[02-8]|" . "6[2-4])|" . "1(?:0[0-578]|1[2-6]|2[235-7])|" . "2(?:0[013-5]|1[2-7]|2[035]|3[01]|4[02-9])|" . "3(?:0[014-68]|1[2-5]|2[0235-7])|" . "4(?:0[0-5]|1[0134]|2[2-8]|3[04-7]|4[2-5]|5[0-3]|6[2-9]|" . "7[0-35-9])|" . "5(?:0[0-46-8]|1[02457]|2[3-7]|3[2-6]|4[235-8]|5[2-6]|" . "6[25]|73)|" . "6(?:0[1246-8]|1[2-5]|2[0-2]|3[013]|4[23]|5[0-25-8]))" . ")", # # Vatican City uses a single postal code, taken from the Italian # system for postal codes; and this code is shared with parts of Rome. # # Data from: http://download.geonames.org/export/zip/CH.zip # 'Vatican City' => "(?k:00120)", ); my %alternatives = ( Australia => [qw /Australian/], France => [qw /French/], Germany => [qw /German/], ); while (my ($country, $zip) = each %zip) { my @names = ($country); push @names => @{$alternatives {$country}} if $alternatives {$country}; foreach my $name (@names) { my $pat_name = $name eq "Denmark" && $] < 5.00503 ? [zip => $name, qw /-country=/] : [zip => $name, qw /-prefix= -country=/]; pattern name => $pat_name, create => sub { my $pt = _t $_ [1] {-prefix}; my $cn = _c $country => $_ [1] {-country}; my $pfx = "(?:(?k:$cn)-)"; "(?k:$pfx$pt$zip)"; }, ; } } # Postal codes of the form 'DDDD LL', with F, I, O, Q, U and Y not # used, SA, SD and SS unused combinations, and the first digit # cannot be 0. No specific meaning to the letters or digits. foreach my $country (qw /Netherlands Dutch/) { pattern name => ['zip', $country => qw /-prefix= -country=/, "-sep= "], create => sub { my $pt = _t $_ [1] {-prefix}; # Unused letters: F, I, O, Q, U, Y. # Unused combinations: SA, SD, SS. my $num = '[1-9][0-9]{3}'; my $let = '[A-EGHJ-NPRTVWXZ][A-EGHJ-NPRSTVWXZ]|' . 'S[BCEGHJ-NPRTVWXZ]'; my $sep = __ $_ [1] {-sep}; my $cn = _c Netherlands => $_ [1] {-country}; my $pfx = "(?:(?k:$cn)-)"; "(?k:$pfx$pt(?k:(?k:$num)(?k:$sep)(?k:$let)))"; }, ; } # Postal codes of the form 'DDDDD' or 'DDDDD-DDDD'. All digits are used, # none carry any specific meaning. pattern name => [qw /zip US -prefix= -country= -extended= -sep=-/], create => sub { my $pt = _t $_ [1] {-prefix}; my $et = _t $_ [1] {-extended}; my $sep = __ $_ [1] {-sep}; my $cn = _c USA => $_ [1] {-country}; my $pfx = "(?:(?k:$cn)-)"; # my $zip = "(?k:[0-9]{5})"; # my $ext = "(?:(?k:$sep)(?k:[0-9]{4}))"; my $zip = "(?k:(?k:[0-9]{3})(?k:[0-9]{2}))"; my $ext = "(?:(?k:$sep)(?k:(?k:[0-9]{2})(?k:[0-9]{2})))"; "(?k:$pfx$pt(?k:$zip$ext$et))"; }, ; # # Postal codes are four digits, but not all combinations are used. # # Valid codes from: # https://postcode.auspost.com.au/free_display.html?id=1 # pattern name => ['zip', 'Australia' => qw /-prefix= -country= -lax=/], create => sub { my $pt = _t $_ [1] {-prefix}; my $cn = _c Australia => $_ [1] {-country}; my $pfx = "(?:(?k:$cn)-)"; my $lax = !defined $_ [1] {-lax} || $_ [1] {-lax}; my $l0 = $lax ? "0?" : "0"; # Leading zero my $pat = "(?|" . "(?|1(?:2(?:15|2[05]|3[05]|40)|" . "3(?:00|35|40|5[05]|60)|" . "4(?:35|45|5[05]|6[056]|7[05]|8[015]|9[059])|" . "5(?:15|6[05]|70|85|9[05])|" . "6(?:3[05]|40|55|60|7[05]|8[05])|" . "7(?:0[01]|1[05]|30|5[05]|65|90)|" . "8(?:0[05]|11|25|35|51|60|7[15]|85|90))" . "|2(?:0(?:0[0-246-9]|1[0-25-9]|[2-4][0-9]|5[0279]|" . "6[0-9]|7[0-79]|8[0-9]|9[02-79])|" . "1(?:[0-2][0-9]|3[0-8]|4[0-8]|5[0-9]|6[0-8]|" . "7[0-9]|9[0-9])|" . "2(?:0[03-9]|1[0-46-9]|2[0-9]|3[0-4]|5[016-9]|" . "6[0-57]|78|8[0-79]|9[0-9])|" . "3(?:0[02-9]|1[0-24-9]|2[0-9]|3[03-9]|4[0-8]|" . "5[0-9]|6[0159]|7[0-29]|8[0-26-8]|9[05-9])|" . "4(?:0[0-689]|1[015]|2[0-9]|3[019]|4[013-9]|" . "5[02-6]|6[02-69]|[78][0-9]|90)|" . "5(?:0[02568]|1[5-9]|2[025-9]|3[03-9]|4[015689]|" . "5[015-9]|6[03-9]|7[0-9]|8[0-8]|9[04])|" . "6(?:0[0-9]|1[0-24-9]|2[0-9]|3[0-3]|4[0-9]|" . "5[0-35689]|6[0135689]|7[1258]|8[01])|" . "7(?:0[0-35-8]|1[0-7]|2[0-25-79]|3[0-9]|4[57-9]|" . "5[0-46-9]|6[0-35-9]|7[03-9]|8[02-7]|9[0-57-9])|" . "8(?:0[03-9]|1[078]|2[0-9]|3[0-689]|4[02-9]|5[02]|" . "6[4-9]|7[013-9]|80|9[089])|" . "9(?:0[0-6]|1[1-4]))" . "|3(?:0(?:0[0-468]|1[0-35689]|2[0-9]|3[0-46-9]|[45][0-9]|" . "6[0-8]|7[0-689]|8[1-57-9]|9[013-79])|" . "1(?:0[1-9]|1[13-6]|2[1-9]|[34][0-9]|5[0-689]|" . "[6-9][0-9])|" . "2(?:0[0-24-7]|1[1-9]|2[0-8]|3[0-9]|4[0-39]|5[014]|" . "6[04-9]|7[0-9]|8[0-79]|9[2-4])|" . "3(?:0[0-59]|1[0-2457-9]|2[1-589]|3[0-578]|4[0-25]|" . "5[0-7]|6[0134]|7[013-57-9]|8[014578]|9[0-356])|" . "4(?:0[0-279]|1[2-589]|2[0347-9]|3[0-578]|4[0-246-8]|" . "5[0138]|6[0-57-9]|7[2578]|8[02357-9]|9[01468])|" . "5(?:0[0-25-79]|1[25-8]|2[0-3579]|3[0137]|4[02469]|" . "5[0-24-9]|6[1-8]|7[0-3569]|8[013-689]|9[014-79])|" . "6(?:0[78]|1[0246-9]|2[0-49]|3[0-9]|4[0134679]|" . "5[89]|6[0-69]|7[0-35-8]|8[2357-9]|9[01457-9])|" . "7(?:0[01457-9]|1[1-57-9]|2[02-8]|3[0235-9]|4[014679]|" . "5[0-9]|6[0-7]|7[057-9]|8[1-35-9]|9[1-35-79])|" . "8(?:0[02-9]|1[02-68]|2[0-5]|3[1-35]|4[0-247]|" . "5[0-46-9]|6[02459]|7[013-58]|8[025-9]|9[0-3568])|" . "9(?:0[02-49]|1[0-35689]|2[0-35-9]|3[01346-9]|4[0-6]|" . "5[01346-9]|6[024-7]|7[15-9]|8[01478]|9[0-256]))" . "|4(?:0(?:0[0-9]|1[0-47-9]|2[0-259]|3[0-24-7]|5[13-59]|" . "6[014-9]|7[02-8])|" . "1(?:0[1-9]|1[0-9]|2[0-57-9]|3[0-3]|5[1-9]|6[013-59]|" . "7[0-489]|8[34])|" . "2(?:0[57-9]|[12][0-9]|30|7[0-25]|8[057])|" . "3(?:0[013-79]|1[0-3]|4[0-7]|5[02-9]|6[0-5]|7[0-8]|" . "8[0-578]|90)|" . "4(?:0[0-8]|1[0-35-9]|2[0-8]|5[45]|6[12578]|" . "7[0-2457-9]|8[0-26-9]|9[0-46-8])|" . "5(?:0[0-9]|1[0-24-9]|2[01]|[56][0-9]|7[0-5]|8[01])|" . "6(?:0[01568]|1[0-5]|2[015-7]|30|5[059]|6[02]|" . "7[01346-8]|80|9[4579])|" . "7(?:0[0-79]|1[0-9]|2[0-8]|3[0-35-9]|4[0-6]|5[013467]|" . "9[89])|" . "8(?:0[02-9]|1[0-9]|2[0-589]|30|49|5[024-9]|" . "6[01589]|7[0-9]|8[0-8]|9[0-25]))" . "|5(?:0(?:0[016-9]|1[0-9]|2[0-5]|3[1-57-9]|4[0-9]|5[0-2]|" . "6[1-9]|7[0-6]|8[1-9]|9[0-8])|" . "1(?:0[6-9]|1[0-8]|2[015-7]|3[1-46-9]|4[0-24]|" . "[56][0-9]|7[0-4])|" . "2(?:0[1-4]|1[0-4]|2[0-3]|3[1-8]|4[0-5]|5[0-69]|" . "6[0-9]|7[0-35-9]|80|9[01])|" . "3(?:0[1-46-9]|1[01]|2[0-2]|3[0-3]|4[0-6]|5[0-7]|" . "60|7[1-4]|81)|" . "4(?:0[01]|1[0-9]|2[0-2]|3[1-4]|40|5[1-5]|6[0-24]|" . "7[0-3]|8[0-35]|9[0135])|" . "5(?:0[12]|10|2[0-3]|40|5[024-68]|60|7[0-35-7]|" . "8[0-3])|" . "6(?:0[0-9]|3[0-3]|4[0-2]|5[0-5]|6[01]|7[01]|80|90)|" . "7(?:0[01]|1[09]|2[02-5]|3[0-4])|" . "9(?:42|50))" . "|6(?:0(?:0[013-9]|1[0-24-9]|2[0-9]|3[0-8]|4[1-4]|" . "[56][0-9]|7[0-46-9]|8[1-4]|90)|" . "1(?:0[0-9]|1[0-2]|2[1-6]|4[7-9]|[56][0-9]|" . "7[0-6]|8[0-2])|" . "2(?:0[7-9]|1[013-58]|2[013-9]|3[0-36769]|4[034]|" . "5[1-68]|6[02]|7[15]|8[0-24-68]|90)|" . "3(?:0[24689]|1[1-35-8]|2[0-46-8]|3[0-35-8]|4[1368]|" . "5[0-35-9]|6[1357-9]|7[0235]|8[3-6]|9[0-8])|" . "4(?:0[13579]|1[0-589]|2[0-9]|3[0-46-8]|4[0235-8]|" . "5[02]|6[0-35-8]|7[0235-79]|8[0457-9]|90)|" . "5(?:0[1-79]|1[0-9]|2[1258]|3[0-25-7]|5[68]|" . "6[0246-9]|7[1245])|" . "6(?:0[35689]|1[2-46]|2[03578]|3[0-2589]|4[026])|" . "7(?:0[157]|1[0-468]|2[0-2568]|3[13]|4[03]|5[1348]|" . "6[025]|70|9[89])|" . "8(?:3[17-9]|4[0-9]|50|65|72|92)|" . "9(?:0[1-79]|1[0-9]|2[0-69]|3[1-69]|4[1-7]|5[1-9]|" . "6[013-9]|7[09]|8[1-9]|9[0-27]))" . "|7(?:0(?:0[0-24-9]|1[0-25-9]|2[0-7]|30|5[0-5])|" . "1(?:09|1[23679]|20|39|40|5[015]|6[23]|7[0-9]|" . "8[02-7]|90)|" . "2(?:09|1[0-6]|4[89]|5[02-9]|6[0-578]|7[05-7]|9[0-2])|" . "3(?:0[0-7]|1[056]|2[0-25]|3[01])|" . "4(?:6[6-9]|70))" . "|8(?:0(?:0[1-9]|1[0-2]))" . "|9726" . # # Place this last, in case the leading 0 is optional; if # not, matching against "2001" would find "200". # "|$l0(?:200|8(?:0[014]|1[0-5]|2[0-289]|3[0-24-9]|4[05-7]|" . "5[0-4]|6[0-2]|7[0-5]|8[0156])|909)" . "))"; "(?k:$pfx$pt(?k:$pat))"; } ; # pattern name => [qw /zip British/, "-sep= "], # create => sub { # my $sep = $_ [1] -> {-sep}; # # my $london = '(?:EC[1-4]|WC[12]|S?W1)[A-Z]'; # my $single = '[BGLMS][0-9]{1,2}'; # my $double = '[A-Z]{2}[0-9]{1,2}'; # # my $left = "(?:$london|$single|$double)"; # my $right = '[0-9][ABD-HJLNP-UW-Z]{2}'; # # "(?k:(?k:$left)(?k:$sep)(?k:$right))"; # }, # ; # # pattern name => [qw /zip Canadian/, "-sep= "], # create => sub { # my $sep = $_ [1] -> {-sep}; # # my $left = '[A-Z][0-9][A-Z]'; # my $right = '[0-9][A-Z][0-9]'; # # "(?k:(?k:$left)(?k:$sep)(?k:$right))"; # }, # ; 1; __END__ =pod =head1 NAME Regexp::Common::zip -- provide regexes for postal codes. =head1 SYNOPSIS use Regexp::Common qw /zip/; while (<>) { /^$RE{zip}{Netherlands}$/ and print "Dutch postal code\n"; } =head1 DESCRIPTION Please consult the manual of L for a general description of the works of this interface. Do not use this module directly, but load it via I. This module offers patterns for zip or postal codes of many different countries. They all have the form C<$RE{zip}{Country}[{options}]>. The following common options are used: =head2 C<{-prefix=[yes|no|allow]}> and C<{-country=PAT}>. Postal codes can be prefixed with a country abbreviation. That is, a Dutch postal code of B<1234 AB> can also be written as B. By default, all the patterns will allow the prefixes. But this can be changed with the C<-prefix> option. With C<-prefix=yes>, the returned pattern requires a country prefix, while C<-prefix=no> disallows a prefix. Any argument that doesn't start with a C or a C allows a country prefix, but doesn't require them. The prefixes used are, unfortunately, not always the same. Officially, ISO country codes need to be used, but the usage of I codes (the same ones as used on cars) is common too. By default, each postal code will recognize a country prefix that's either the ISO standard or the CEPT code. That is, German postal codes may prefixed with either C or C. The recognized prefix can be changed with the C<-country> option, which takes a (sub)pattern as argument. The arguments C and C are special, and indicate the language prefix should be the ISO country code, or the CEPT code. Examples: /$RE{zip}{Netherlands}/; # Matches '1234 AB' and 'NL-1234 AB'. /$RE{zip}{Netherlands}{-prefix => 'no'}/; # Matches '1234 AB' but not 'NL-1234 AB'. /$RE{zip}{Netherlands}{-prefix => 'yes'}/; # Matches 'NL-1234 AB' but not '1234 AB'. /$RE{zip}{Germany}/; # Matches 'DE-12345' and 'D-12345'. /$RE{zip}{Germany}{-country => 'iso'}/; # Matches 'DE-12345' but not 'D-12345'. /$RE{zip}{Germany}{-country => 'cept'}/; # Matches 'D-12345' but not 'DE-12345'. /$RE{zip}{Germany}{-country => 'GER'}/; # Matches 'GER-12345'. =head2 C<{-sep=PAT}> Some countries have postal codes that consist of two parts. Typically there is an official way of separating those parts; but in practise people tend to use different separators. For instance, if the official way to separate parts is to use a space, it happens that the space is left off. The C<-sep> option can be given a pattern as argument which indicates what to use as a separator between the parts. Examples: /$RE{zip}{Netherlands}/; # Matches '1234 AB' but not '1234AB'. /$RE{zip}{Netherlands}{-sep => '\s*'}/; # Matches '1234 AB' and '1234AB'. =head2 C<$RE{zip}{Australia}{-lax}> Returns a pattern that recognizes Australian postal codes. Australian postal codes consist of four digits; the first two digits, which range from '10' to '97', indicate the state, although there are exceptions. Territories use '02' or '08' as starting digits. '0909' is the only postal code starting with '09' - this is the postal code for the Northern Territory University). The (optional) country prefixes are I (ISO country code) and I (CEPT code). It the past, it was claimed that for postal codes starting with a 0, the leading 0 may be omitted, and up to (and including) version 2016060201, the leading 0 was optional. But there doesn't seem be solid evidence the leading 0 is optional. So, we now require there always to be four digit -- unless the C<< {-lax} >> option is given, then a possibly leading 0 is optional. Regexp::Common 2.107 and before used C<$RE{zip}{Australian}>. This is still supported. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back As of version 2016060201, no C<< $4 >> or C<< $5 >> will be set. =head2 C<< $RE {zip} {Austria} >> Returns a pattern which recognizes Austrian postal codes. Austrian postal codes consists of 4 digits, but not all possibilities are used. This pattern matches the postal codes in use. The (optional) country prefixes are I (ISO country code) and I (CEPT code). If C<< {-keep} >> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country code prefix. =back =head2 C<$RE{zip}{Belgium}> Returns a pattern than recognizes Belgian postal codes. Belgian postal codes consist of 4 digits, of which the first indicates the province. The (optional) country prefixes are I (ISO country code) and I (CEPT code). If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back =head2 C<$RE{zip}{Denmark}> Returns a pattern that recognizes Danish postal codes. Danish postal codes consist of four numbers; the first digit indicates the distribution region, the second the distribution district. The (optional) country prefix is I, which is both the ISO country code and the CEPT code. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back Danish postal codes will not start with 39. Postal codes of the form 39XX are reserved from Greenland; the pattern for Danish postal codes will not recognize them. =head2 C<$RE{zip}{France}> Returns a pattern that recognizes French postal codes. French postal codes consist of five numbers; the first two numbers, which range from '01' to '98', indicate the department. The (optional) country prefixes are I (ISO country code) and I (CEPT code). Regexp::Common 2.107 and before used C<$RE{zip}{French}>. This is still supported. Monaco uses postal codes which are part of the numbering system used by the French postal code system; their numbers start with 980. These numbers are C<< not >> recognized by this pattern. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back =head2 C<$RE{zip}{Germany}> Returns a pattern that recognizes German postal codes. German postal codes consist of five numbers; the first two numbers indicating a wider postal area, the last three digits a postal district. The (optional) country prefixes are I (ISO country code) and I (CEPT code). Regexp::Common 2.107 and before used C<$RE{zip}{German}>. This is still supported. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back =head2 C<$RE{zip}{Greenland}> Returns a pattern that recognizes postal codes from Greenland. Greenland, uses the Danish postal codes system. Postal codes starting with 39 are reserved for Greenland, and all Greenlandic postal codes start with 39. Except the postal code for Santa. He uses 2412. The (optional) country prefix is I, which is use both as the ISO country code and the CEPT code. Earlier versions used I as the prefix. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back =head2 C<$RE{zip}{Italy}> Returns a pattern recognizing Italian postal codes. Italian postal codes consist of 5 digits. The first digit indicates the region, the second the province. The third digit is odd for province capitals, and even for the province itself. The fourth digit indicates the route, and the fifth a place on the route (0 for small places, alphabetically for the rest). Codes starting with 4789 are postal codes for San Marino; they are not recognized by the pattern. Use C<< $RE {zip} {'San Marino'} >> instead. The country prefix is either I (the ISO country code), or I (the CEPT code). If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back =head2 C<< $RE {zip} {Liechtenstein} >> Returns a pattern which recognizes postal codes used in Liechtenstein. Liechtenstein uses postal codes from the Swiss postal code system. This system uses four digits. Postal codes which start with 94, and use 8 or 9 as a third digit are postal codes for Liechtenstein. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back The ISO country prefix is I<< LI >>, the CEPT country prefix is I<< LIE >>. =head2 C<< $RE {zip {Monaco} >> Returns a pattern for postal codes used in Monaco. Monaco uses a range from the system used in France. They are 5 digits, starting with I<< 980 >>. The number I<< 98000 >> is used for physical addresses. Numbers ending in C<< 01 >> to C<< 99 >> are used for special deliveries. The ISO country code is I<< MC >>. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back =head2 C<$RE{zip}{Netherlands}> Returns a pattern that recognizes Dutch postal codes. Dutch postal codes consist of 4 digits and 2 letters, separated by a space. The separator can be changed using the C<{-sep}> option, as discussed above. The (optional) country prefix is I, which is both the ISO country code and the CEPT code. Regexp::Common 2.107 and earlier used C<$RE{zip}{Dutch}>. This is still supported. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =item $4 The digits part of the postal code. =item $5 The separator between the digits and the letters. =item $6 The letters part of the postal code. =back =head2 C<< $RE{zip}{Norway} >> Returns a pattern that recognizes Norwegian postal codes. Norwegian postal codes consist of four digits. The country prefix is either I (the ISO country code), or I (the CEPT code). If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back =head2 C<< $RE {zip} {'San Marino'} >> Postal codes of San Marino use a slice from the Italian postal codes. Any code starting 4789, followed by another digit belongs to San Marino. The country prefix for San Marino is I<< SM >>. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back =head2 C<< $RE{zip}{Spain} >> Returns a pattern that recognizes Spanish postal codes. Spanish postal codes consist of 5 digits. The first 2 indicate one of Spain's fifties provinces (in alphabetical order), starting with C<00>. The third digit indicates a main city or the main delivery rounds. The last two digits are the delivery area, secondary delivery route or a link to rural areas. The country prefix is either I (the ISO country code), or I (the CEPT code). If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =item $4 The two digits indicating the province. =item $5 The digit indicating the main city or main delivery route. =item $6 The digits indicating the delivery area, secondary delivery route or a link to rural areas. =back =head2 C<< $RE {zip} {Switzerland} >> Returns a pattern that recognizes Swiss postal codes. Swiss postal codes consist of 4 digits, but not all combinations are used. Postal codes starting with 948 and 949 are for location in Liechtenstein, and will not be recognized by the pattern for Swiss postal codes. Use C<< $RE {zip} {Liechtenstein} >> for those. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back The country prefix is I, for both the ISO and CEPT prefixes. =head2 C<< $RE{zip}{US}{-extended => [yes|no|allow]} >> Returns a pattern that recognizes US zip codes. US zip codes consist of 5 digits, with an optional 4 digit extension. By default, extensions are allowed, but not required. This can be influenced by the C<-extended> option. If its argument starts with a C, extensions are required; if the argument starts with a C, extensions will not be recognized. If an extension is used, a dash is used to separate the main part from the extension, but this can be changed with the C<-sep> option. The country prefix is either I (the ISO country code), or I (the CEPT code). If C<{-keep}> is being used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =item $4 The first 5 digits of the postal code. =item $5 The first three digits of the postal code, indicating a sectional center or a large city. New in Regexp::Common 2.119. =item $6 The last 2 digits of the 5 digit part of the postal code, indicating a post office facility or delivery area. New in Regexp::Common 2.119. =item $7 The separator between the 5 digit part and the 4 digit part. Up to Regexp::Common 2.118, this used to be $5. =item $8 The 4 digit part of the postal code (if any). Up to Regexp::Common 2.118, this used to be $6. =item $9 The first two digits of the 4 digit part of the postal code, indicating a sector, or several blocks. New in Regexp::Common 2.119. =item $10 The last two digits of the 4 digit part of the postal code, indicating a segment or one side of a street. New in Regexp::Common 2.119. =back =head3 Questions =over 4 =item Can the 5 digit part of the zip code (in theory) start with 000? =item Can the 5 digit part of the zip code (in theory) end with 00? =item Can the 4 digit part of the zip code (in theory) start with 00? =item Can the 4 digit part of the zip code (in theory) end with 00? =back =head2 C<< $RE {zip} {'Vatican City'} >> Vatican City uses a single postal code; taken from the Italian system of postal codes, and sharing the single code with a part of Rome. If C<{-keep}> is used, the following variables will be set: =over 4 =item $1 The entire postal code. =item $2 The country code prefix. =item $3 The postal code without the country prefix. =back The country prefix for Vatican City is C<< VA >>. =head1 SEE ALSO L for a general description of how to use this interface. =over 4 =item L Frank's compulsive guide to postal addresses. =item L Postal addressing systems. =item L Postal code information. =item L Links to Postcode Pages. =item L All Australian postal codes in use. =item L Information about US postal codes. =item L =item L Lots of zip files with active postal codes. =item L Find postal codes. =back =head1 AUTHORS Damian Conway S<(I)> and Abigail S<(I)>. =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Zip codes for most countries are missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PK]pU  Common/URI.pmnu6$package Regexp::Common::URI; use 5.10.0; use strict; use warnings; no warnings 'syntax'; use Exporter (); our @ISA = qw /Exporter/; our @EXPORT_OK = qw /register_uri/; use Regexp::Common qw /pattern clean no_defaults/; our $VERSION = '2024080801'; # Use 'require' here, not 'use', so we delay running them after we are compiled. # We also do it using an 'eval'; this saves us from have repeated similar # lines. The eval is further explained in 'perldoc -f require'. my @uris = qw /fax file ftp gopher http pop prospero news tel telnet tv wais/; foreach my $uri (@uris) { eval "require Regexp::Common::URI::$uri"; die $@ if $@; } my %uris; sub register_uri { my ($scheme, $uri) = @_; $uris {$scheme} = $uri; } pattern name => [qw (URI)], create => sub {my $uri = join '|' => values %uris; $uri =~ s/\(\?k:/(?:/g; "(?k:$uri)"; }, ; 1; __END__ =pod =head1 NAME Regexp::Common::URI -- provide patterns for URIs. =head1 SYNOPSIS use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{HTTP}/ and print "Contains an HTTP URI.\n"; } =head1 DESCRIPTION Patterns for the following URIs are supported: fax, file, FTP, gopher, HTTP, news, NTTP, pop, prospero, tel, telnet, tv and WAIS. Each is documented in the I>, manual page, for the appropriate scheme (in lowercase), except for I URIs which are found in I. =head2 C<$RE{URI}> Return a pattern that recognizes any of the supported URIs. With C<{-keep}>, only the entire URI is returned (in C<$1>). =head1 REFERENCES =over 4 =item B<[DRAFT-URI-TV]> Zigmond, D. and Vickers, M: I. December 2000. =item B<[DRAFT-URL-FTP]> Casey, James: I. November 1996. =item B<[RFC 1035]> Mockapetris, P.: I. November 1987. =item B<[RFC 1738]> Berners-Lee, Tim, Masinter, L., McCahill, M.: I. December 1994. =item B<[RFC 2396]> Berners-Lee, Tim, Fielding, R., and Masinter, L.: I. August 1998. =item B<[RFC 2616]> Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P. and Berners-Lee, Tim: I. June 1999. =item B<[RFC 2806]> Vaha-Sipila, A.: I. April 2000. =back =head1 SEE ALSO L for a general description of how to use this interface. =head1 AUTHOR Damian Conway (damian@conway.org) =head1 MAINTENANCE This package is maintained by Abigail S<(I)>. =head1 BUGS AND IRRITATIONS Bound to be plenty. For a start, there are many common regexes missing. Send them in to I. =head1 LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2024, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD License. See the file COPYRIGHT.BSD. 4) The MIT License. See the file COPYRIGHT.MIT. =cut PKF]} Q Q Common/.packlistnu[/usr/local/share/man/man3/Regexp::Common.3pm /usr/local/share/man/man3/Regexp::Common::CC.3pm /usr/local/share/man/man3/Regexp::Common::SEN.3pm /usr/local/share/man/man3/Regexp::Common::URI.3pm /usr/local/share/man/man3/Regexp::Common::URI::RFC1035.3pm /usr/local/share/man/man3/Regexp::Common::URI::RFC1738.3pm /usr/local/share/man/man3/Regexp::Common::URI::RFC1808.3pm /usr/local/share/man/man3/Regexp::Common::URI::RFC2384.3pm /usr/local/share/man/man3/Regexp::Common::URI::RFC2396.3pm /usr/local/share/man/man3/Regexp::Common::URI::RFC2806.3pm /usr/local/share/man/man3/Regexp::Common::URI::fax.3pm /usr/local/share/man/man3/Regexp::Common::URI::file.3pm /usr/local/share/man/man3/Regexp::Common::URI::ftp.3pm /usr/local/share/man/man3/Regexp::Common::URI::gopher.3pm /usr/local/share/man/man3/Regexp::Common::URI::http.3pm /usr/local/share/man/man3/Regexp::Common::URI::news.3pm /usr/local/share/man/man3/Regexp::Common::URI::pop.3pm /usr/local/share/man/man3/Regexp::Common::URI::prospero.3pm /usr/local/share/man/man3/Regexp::Common::URI::tel.3pm /usr/local/share/man/man3/Regexp::Common::URI::telnet.3pm /usr/local/share/man/man3/Regexp::Common::URI::tv.3pm /usr/local/share/man/man3/Regexp::Common::URI::wais.3pm /usr/local/share/man/man3/Regexp::Common::_support.3pm /usr/local/share/man/man3/Regexp::Common::balanced.3pm /usr/local/share/man/man3/Regexp::Common::comment.3pm /usr/local/share/man/man3/Regexp::Common::delimited.3pm /usr/local/share/man/man3/Regexp::Common::lingua.3pm /usr/local/share/man/man3/Regexp::Common::list.3pm /usr/local/share/man/man3/Regexp::Common::net.3pm /usr/local/share/man/man3/Regexp::Common::number.3pm /usr/local/share/man/man3/Regexp::Common::profanity.3pm /usr/local/share/man/man3/Regexp::Common::whitespace.3pm /usr/local/share/man/man3/Regexp::Common::zip.3pm /usr/local/share/perl5/Regexp/Common.pm /usr/local/share/perl5/Regexp/Common/CC.pm /usr/local/share/perl5/Regexp/Common/SEN.pm /usr/local/share/perl5/Regexp/Common/URI.pm /usr/local/share/perl5/Regexp/Common/URI/RFC1035.pm /usr/local/share/perl5/Regexp/Common/URI/RFC1738.pm /usr/local/share/perl5/Regexp/Common/URI/RFC1808.pm /usr/local/share/perl5/Regexp/Common/URI/RFC2384.pm /usr/local/share/perl5/Regexp/Common/URI/RFC2396.pm /usr/local/share/perl5/Regexp/Common/URI/RFC2806.pm /usr/local/share/perl5/Regexp/Common/URI/fax.pm /usr/local/share/perl5/Regexp/Common/URI/file.pm /usr/local/share/perl5/Regexp/Common/URI/ftp.pm /usr/local/share/perl5/Regexp/Common/URI/gopher.pm /usr/local/share/perl5/Regexp/Common/URI/http.pm /usr/local/share/perl5/Regexp/Common/URI/news.pm /usr/local/share/perl5/Regexp/Common/URI/pop.pm /usr/local/share/perl5/Regexp/Common/URI/prospero.pm /usr/local/share/perl5/Regexp/Common/URI/tel.pm /usr/local/share/perl5/Regexp/Common/URI/telnet.pm /usr/local/share/perl5/Regexp/Common/URI/tv.pm /usr/local/share/perl5/Regexp/Common/URI/wais.pm /usr/local/share/perl5/Regexp/Common/_support.pm /usr/local/share/perl5/Regexp/Common/balanced.pm /usr/local/share/perl5/Regexp/Common/comment.pm /usr/local/share/perl5/Regexp/Common/delimited.pm /usr/local/share/perl5/Regexp/Common/lingua.pm /usr/local/share/perl5/Regexp/Common/list.pm /usr/local/share/perl5/Regexp/Common/net.pm /usr/local/share/perl5/Regexp/Common/number.pm /usr/local/share/perl5/Regexp/Common/profanity.pm /usr/local/share/perl5/Regexp/Common/whitespace.pm /usr/local/share/perl5/Regexp/Common/zip.pm PK] $ ugug Common.pmnu6$PK]b gCommon/SEN.pmnu6$PK]a)::uCommon/number.pmnu6$PK]?n İCommon/lingua.pmnu6$PK]az00Common/delimited.pmnu6$PK]3 Common/profanity.pmnu6$PK]ވ||Common/comment.pmnu6$PK]؉ڗyCommon/balanced.pmnu6$PK] Common/list.pmnu6$PK]F7 7 Common/CC.pmnu6$PK]WmW  qCommon/_support.pmnu6$PK]R}33 ӳCommon/net.pmnu6$PK]-t Common/URI/news.pmnu6$PK]MGICommon/URI/telnet.pmnu6$PK]Tpww-Common/URI/ftp.pmnu6$PK]=# Common/URI/fax.pmnu6$PK] Common/URI/RFC2806.pmnu6$PK]d\  =Common/URI/pop.pmnu6$PK]v  'FCommon/URI/RFC2384.pmnu6$PK]< ~OCommon/URI/tel.pmnu6$PK](>aZCommon/URI/RFC2396.pmnu6$PK]oCommon/URI/RFC1035.pmnu6$PK]i^ ^ wCommon/URI/http.pmnu6$PK]<;""WCommon/URI/file.pmnu6$PK]O Common/URI/wais.pmnu6$PK]lk<Common/URI/tv.pmnu6$PK]*JJCommon/URI/RFC1738.pmnu6$PK]\4=Common/URI/gopher.pmnu6$PK]i5Common/URI/RFC1808.pmnu6$PK]t:nnkCommon/URI/prospero.pmnu6$PK]gzCommon/whitespace.pmnu6$PK]Mʆ Common/zip.pmnu6$PK]pU  Common/URI.pmnu6$PKF]} Q Q rCommon/.packlistnu[PK""