Commit 7f6a5964 authored by Volker Krause's avatar Volker Krause
Browse files

More precise Renfe barcode filter expression

This now also works with Code 128 1D barcodes used by Renfe.
parent 797b2fa7
......@@ -14,12 +14,13 @@ function parseBarcode(barcode)
// 5x train number
// 3x coach number
// 3x seat number
// 3x unknown number
// 2x unknown number
// 1x unknown number
// 6x "localizador" ~ PNR?
// ".." (optional)
// 5x "CombinadoCercanias" (optional)
if (barcode.length > 56)
if (barcode.trim().length > 56)
return null;
// trim not set combined commuter section, so merging with a document that has that set works properly
......
......@@ -25,7 +25,7 @@
{
"filter": [
{
"match": "^\\d{29}.*\\S{6}(\\.\\.\\S{5}| +)?$",
"match": "^\\d{29}.*(\\S{6}(\\.\\.\\S{5}| +))?$",
"mimeType": "text/plain",
"scope": "Current"
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment