Update gen_gs1_lint.php re new Digital Link dlpkey in gs1-format-spec.txt

This commit is contained in:
gitlost 2021-03-15 15:27:20 +00:00
parent 09e7427259
commit 20663b4eed

View File

@ -44,12 +44,12 @@ foreach ($lines as $line) {
if ($line === '' || $line[0] === '#') { if ($line === '' || $line[0] === '#') {
continue; continue;
} }
if (!preg_match('/^([0-9]+(?:-[0-9]+)?) +([ *] )([NXC][0-9.][ NXC0-9.,a-z]*)(?:# (.+))?$/', $line, $matches)) { if (!preg_match('/^([0-9]+(?:-[0-9]+)?) +([ *] )([NXC][0-9.][ NXC0-9.,a-z=|]*)(?:# (.+))?$/', $line, $matches)) {
exit("$basename:" . __LINE__ . " ERROR: Could not parse line $line_no" . PHP_EOL); exit("$basename:" . __LINE__ . " ERROR: Could not parse line $line_no" . PHP_EOL);
} }
$ai = $matches[1]; $ai = $matches[1];
$fixed = trim($matches[2]); $fixed = trim($matches[2]);
$spec = trim($matches[3]); $spec = preg_replace('/ +dlpkey[=0-9,|]*/', '', trim($matches[3])); // Strip Digital Link primary key info
$comment = isset($matches[4]) ? trim($matches[4]) : ''; $comment = isset($matches[4]) ? trim($matches[4]) : '';
if (isset($spec_ais[$spec])) { if (isset($spec_ais[$spec])) {