use strict; use warnings; sub string_type { $_ = shift; my $type # format ? type = /^\d{2}.\d{2}.\d{2}$/ ? 'date' : /^\d{2}.\d{2}.\d{4}$/ ? 'date' : /^[A-Z]{2}\d{9}[A-Z]{2}$/ ? 'Royal Mail Track & Trace code +' : /^\d{16}$/ ? 'visa card' : /^\d{13}$/ ? 'EAN-13 barcode' : 'unrecoginized string' ; if ($type eq 'EAN-13 barcode') { ... # Handle sub-types } return $type; }
In reply to Re: Pattern Identification
by BillKSmith
in thread Pattern Identification
by WhiteTraveller
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |