4 ms·
Why pyparsing, not ply or regex?
by denfromufa 10y ago
Why pyparsing, not ply or regex?
- viraptor 10y agoNever used ply, but why not regex? Regex cannot easily match recursive structures, and can't be easily composed. Pyparsing gives you more structure and ready building blocks. It actually can use regex as one of the term objects. Ply tries to implement lex/yacc only, so it's far from a nice interface really... Or specifically: it's trivial to match `specific_func(any_expression, {capture, these, values})`, but it's practically impossible with regex and painful to post-process with ply.
- ggurgone 10y agoregexps are error prone better use ASTs see Facebook's jscodeshift
- coredog64 10y agoJamie Zawinski <jwz@netscape.com> wrote on Tue, 12 Aug 1997 13:16:22 -0700: Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.
- pkroll 10y ago"I've noticed that when I get quoted in .sig files, it's never any of the actual clever things I say all the time. Usually it's something dumb." --Jamie Zawinski