UPC: Difference between revisions
m
→{{header|Perl}}: less cryptic regex
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: less cryptic regex) |
|||
Line 327:
$pattern_to_digit_2{$patterns2[$_]} = $_ for 0..$#patterns2;
my $re = '\s*# #\s*
"(?<match1>(?:@{[join '|', @patterns1]}){6})" .
'\s*# #\s*' .
"(?<match2>(?:@{[join '|', @patterns2]}){6})" .
'\s*# #\s*';
$line =~ /^$re$/g || return;
my($match1,$match2) = ($
push @digits, $pattern_to_digit_1{$_} for $match1 =~ /(.......)/g;
push @digits, $pattern_to_digit_2{$_} for $match2 =~ /(.......)/g;
|