winfinit / aamvajs

AAMVA parser
BSD 3-Clause "New" or "Revised" License
35 stars 28 forks source link

Order is not Guaranteed #9

Open jarodhanko opened 6 years ago

jarodhanko commented 6 years ago

Perhaps this is merely a bad test case but this image http://www.lcb.pa.gov/Education/PublishingImages/BackOf2017DL.jpg which follows the order of data as presented in the recent specifications of AAMVA (See D.13 Example of raw PDF417 data)

yields a data string of

@ ANSI 636025080002DL00410268ZP03090030DLDAQ99999999 DCSSAMPLE DDEU DACJANICE DDFU DADANN DDGU DCAC DCBNONE DCDNONE DBD10052015 DBB08041969 DBA08042023 DBC2 DAU066 IN DAYBRO DAG123 MAIN STREET DAIHARRISBURG DAJPA DAK171010000 DCF1234567890123456789012345 DCGUSA DCK1234567890123456 DDB10012015 DDK1 DDL1 ZPZPAN ZPB00 ZPC123 ZPDNONE

which fails to match the regex due to out of order element id's.

ibotva commented 1 year ago

I know this is old, but if you passed that string to the parser, it will error because there are no line feed characters which is against AAMVA specification.