3 ms·
The simplest case where they prove useful is usually when your regex is longest than 20 characters. Write a parser once, and it'll be readable to people other t
by mhh__ 6y ago
The simplest case where they prove useful is usually when your regex is longest than 20 characters. Write a parser once, and it'll be readable to people other than yourself (if it isn't your schema is bad)
- MaxBarraclough 6y agoSeems a pity to throw out the various advantages of the high-level solution just because your regex engine doesn't support a scalable syntax. Advanced regex systems such as the Ragel parser-generator support a composition-friendly syntax, [0] but the average regex system doesn't, and I guess there's no quick fix for that. [0] http://thingsaaronmade.com/blog/a-simple-intro-to-writing-a-lexer-with-ragel.html http://thingsaaronmade.com/blog/a-simple-intro-to-writing-a-...