Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45885

Re: Utility to locate errors in regular expressions

References <knno5h$t9f$1@ger.gmane.org>
From Devin Jeanpierre <jeanpierreda@gmail.com>
Date 2013-05-24 09:13 -0400
Subject Re: Utility to locate errors in regular expressions
Newsgroups comp.lang.python
Message-ID <mailman.2065.1369401265.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, May 24, 2013 at 8:58 AM, Malte Forkel <malte.forkel@berlin.de> wrote:
> As a first step, I am looking for a parser for Python regular
> expressions, or a Python regex grammar to create a parser from.

the sre_parse module is undocumented, but very usable.

> But may be my idea is flawed? Or a similar (or better) tools already
> exists? Any advice will be highly appreciated!

I think your task is made problematic by the possibility that no
single part of the regexp causes a match failure. What causes failure
depends on what branches are chosen with the |, *, +, ?, etc.
operators -- it might be a different character/subexpression for each
branch. And then there's exponentially many possible branches.

-- Devin

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Utility to locate errors in regular expressions Devin Jeanpierre <jeanpierreda@gmail.com> - 2013-05-24 09:13 -0400
  Re: Utility to locate errors in regular expressions Roy Smith <roy@panix.com> - 2013-05-24 09:40 -0400

csiph-web