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