1a96e001bSPeter Avalos#-------------------------------------------- 2a96e001bSPeter Avalos# marc21: file(1) magic for MARC 21 Format 3a96e001bSPeter Avalos# 4a96e001bSPeter Avalos# Kevin Ford (kefo@loc.gov) 5a96e001bSPeter Avalos# 6a96e001bSPeter Avalos# MARC21 formats are for the representation and communication 7a96e001bSPeter Avalos# of bibliographic and related information in machine-readable 86fca56fbSSascha Wildner# form. For more info, see https://www.loc.gov/marc/ 9a96e001bSPeter Avalos 10a96e001bSPeter Avalos 11a96e001bSPeter Avalos# leader position 20-21 must be 45 12*c30bd091SSascha Wildner# and 22-23 also 00 so far, but we check that later. 13a96e001bSPeter Avalos20 string 45 14*c30bd091SSascha Wildner>0 search/2048 \x1e 15a96e001bSPeter Avalos 16a96e001bSPeter Avalos# leader starts with 5 digits, followed by codes specific to MARC format 17*c30bd091SSascha Wildner>>0 regex/1l (^[0-9]{5})[acdnp][^bhlnqsu-z] MARC21 Bibliographic 18a96e001bSPeter Avalos!:mime application/marc 19*c30bd091SSascha Wildner>>0 regex/1l (^[0-9]{5})[acdnosx][z] MARC21 Authority 20a96e001bSPeter Avalos!:mime application/marc 21*c30bd091SSascha Wildner>>0 regex/1l (^[0-9]{5})[cdn][uvxy] MARC21 Holdings 22a96e001bSPeter Avalos!:mime application/marc 23*c30bd091SSascha Wildner>>0 regex/1l (^[0-9]{5})[acdn][w] MARC21 Classification 24a96e001bSPeter Avalos!:mime application/marc 25*c30bd091SSascha Wildner>>0 regex/1l (^[0-9]{5})[cdn][q] MARC21 Community 26a96e001bSPeter Avalos!:mime application/marc 27a96e001bSPeter Avalos 28a96e001bSPeter Avalos# leader position 22-23, should be "00" but is it? 29*c30bd091SSascha Wildner>>0 regex/1l (^.{21})([^0]{2}) (non-conforming) 30a96e001bSPeter Avalos!:mime application/marc 31