Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #45881
| From | Malte Forkel <malte.forkel@berlin.de> |
|---|---|
| Subject | Utility to locate errors in regular expressions |
| Date | 2013-05-24 14:58 +0200 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2062.1369400329.3114.python-list@python.org> (permalink) |
Finding out why a regular expression does not match a given string can very tedious. I would like to write a utility that identifies the sub-expression causing the non-match. My idea is to use a parser to create a tree representing the complete regular expression. Then I could simplify the expression by dropping sub-expressions one by one from right to left and from bottom to top until the remaining regex matches. The last sub-expression dropped should be (part of) the problem. As a first step, I am looking for a parser for Python regular expressions, or a Python regex grammar to create a parser from. But may be my idea is flawed? Or a similar (or better) tools already exists? Any advice will be highly appreciated! Malte
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Utility to locate errors in regular expressions Malte Forkel <malte.forkel@berlin.de> - 2013-05-24 14:58 +0200
Re: Utility to locate errors in regular expressions Roy Smith <roy@panix.com> - 2013-05-24 09:12 -0400
Re: Utility to locate errors in regular expressions Neil Cerutti <neilc@norwich.edu> - 2013-05-24 13:58 +0000
Re: Utility to locate errors in regular expressions rusi <rustompmody@gmail.com> - 2013-05-24 07:09 -0700
Re: Utility to locate errors in regular expressions Christian Gollwitzer <auriocus@gmx.de> - 2013-05-24 20:21 +0200
csiph-web