Revision 766c828a
Von Steven Schubiger vor mehr als 2 Jahren hinzugefügt
SL/Helper/QrBill.pm | ||
---|---|---|
120 | 120 |
[ 'type', qr{^(?:QRR|NON)$} ], |
121 | 121 |
], |
122 | 122 |
additional => { |
123 |
'ref_nr' => { |
|
124 |
QRR => qr{^\d{27}$}, |
|
125 |
NON => qr{^$}, |
|
126 |
}, |
|
123 | 127 |
'qr_iban' => qr{^.{4}3[01][0-9]{3}.{12}$}, |
124 | 128 |
}, |
125 | 129 |
); |
... | ... | |
169 | 173 |
} |
170 | 174 |
|
171 | 175 |
$group = 'reference number data'; |
172 |
my %ref_nr_regexes = ( |
|
173 |
QRR => qr{^\d{27}$}, |
|
174 |
NON => qr{^$}, |
|
175 |
); |
|
176 | 176 |
foreach my $re (@{$regexes{$group}}) { |
177 | 177 |
$check_re->($group, $ref_nr_data, @$re); |
178 | 178 |
} |
179 |
$check_re->($group, $ref_nr_data, 'ref_number', $ref_nr_regexes{$ref_nr_data->{type}});
|
|
179 |
$check_re->($group, $ref_nr_data, 'ref_number', $regexes{additional}->{ref_nr}{$ref_nr_data->{type}});
|
|
180 | 180 |
|
181 | 181 |
$group = 'biller information'; |
182 | 182 |
if ($ref_nr_data->{type} eq 'QRR') { |
Auch abrufbar als: Unified diff
Swiss QR-Bill: QrBill.pm: Verschiebe Reguläre Ausdrücke zur Validierung von Referenznummern