4 ms·
Especially when the spec itself is in EBNF.
by aphyr 16y ago
Especially when the spec itself is in EBNF.
- _delirium 16y agoTrue, though it's EBNF with a bunch of explanatory text and annotations. What would be interesting, but I can't find with some googling: Has someone implemented a parser-generator based on the spec? The ideal would be that the parser specification looks a lot like the RFC, since then you'd have more confidence it was actually correct (and it'd be easier to maintain for future changes).
- aphyr 16y agoMy comment above is a regex derived straightforwardly from the spec. Not a full parser, though.
- twopoint718 16y agoThere was a long post on the topic of 'regex-vs-parser' for email on reddit a while back. I hope I'm pointing to the correct person, but he wrote a parser in Haskell that validates against RFC5322: http://hackage.haskell.org/package/email-validate http://hackage.haskell.org/package/email-validate