Added barcode format validation function