VIN: Fix for the VIN plugin.

Trouble with the regexp shows the VIN plugin with queries such as "sha 19UYA426X1A000934."
master
Jag Talon 2013-04-14 18:58:04 -04:00
parent f4e8f26e28
commit 0afd2e2184
1 changed files with 1 additions and 3 deletions

View File

@ -92,15 +92,13 @@ handle query_nowhitespace_nodash => sub {
# Exclsuive trigger.
if ($query =~ /^$vin_qr.*?([A-Z\d]{17,})$/i || $query =~ /^([A-Z\d]{17,}).*?$vin_qr$/i) {
# warn "test\n";
$vin_number = uc $1;
$is_vin = 2;
# No exclusive trigger, do checksum.
# Since the vin numbers are just numbers,
# we are more strict in regex (e.g. than UPS).
} elsif($query =~ /^(?:$tracking_qr|$vin_qr|)*([A-Z\d]{17}?)(?:$tracking_qr|$vin_qr|)*$/io || $query =~ /(?:$tracking_qr|$vin_qr|)*([A-Z\d]{17})(?:$tracking_qr|$vin_qr|)*$/io) {
} elsif($query =~ /^(?:$tracking_qr|$vin_qr|)*([A-Z\d]{17}?)(?:$tracking_qr|$vin_qr|)*$/io || $query =~ /^(?:$tracking_qr|$vin_qr|)*([A-Z\d]{17})(?:$tracking_qr|$vin_qr|)*$/io) {
$vin_number = uc $1;
my $checksum = 0;