[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fixing ill-conditioned regular expressions. Proof of concept.
From: |
Alan Mackenzie |
Subject: |
Re: Fixing ill-conditioned regular expressions. Proof of concept. |
Date: |
Thu, 26 Feb 2015 10:11:37 +0000 |
User-agent: |
Mutt/1.5.22 (2013-10-16) |
Hello, Paul.
On Thu, Feb 26, 2015 at 12:46:58AM -0800, Paul Eggert wrote:
> Alan Mackenzie wrote:
> > More to the point, it is sometimes
> > not possible to preserve the numbering of \(...\) constructs while
> > fixing a regexp, which would change the match-data.
> Sure, but you could remember how the \(...\) constructs were
> renumbered, and fix the match data after the underlying regexp call
> returned. It shouldn't be a big deal.
Unfortunately, it's not that simple. Consider the RE
\(R\)+E*\(R\)+
1 1 2 2
. This gets transformed to
\(R\)+\(?:E+\(R\)+\|\(R\)\)
1 1 2 2 2 2
. What was subexpression 2 in the original has become two subexpressions
straddling an \| sign in the transformation. I don't think there's a way
of transforming R+E*R+ that preserves the numbering of the
subexpressions.
--
Alan Mackenzie (Nuremberg, Germany).
- Fixing ill-conditioned regular expressions. Proof of concept., Alan Mackenzie, 2015/02/23
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Paul Eggert, 2015/02/23
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Alan Mackenzie, 2015/02/23
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Paul Eggert, 2015/02/23
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Alan Mackenzie, 2015/02/23
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Artur Malabarba, 2015/02/23
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Paul Eggert, 2015/02/23
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Alan Mackenzie, 2015/02/25
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Stephen J. Turnbull, 2015/02/25
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Paul Eggert, 2015/02/26
- Re: Fixing ill-conditioned regular expressions. Proof of concept.,
Alan Mackenzie <=
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Tassilo Horn, 2015/02/26
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Alan Mackenzie, 2015/02/26
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Stefan Monnier, 2015/02/26
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Alan Mackenzie, 2015/02/26
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Stefan Monnier, 2015/02/26
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Alan Mackenzie, 2015/02/26
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Stefan Monnier, 2015/02/27
- Re: Fixing ill-conditioned regular expressions. Proof of concept., Stefan Monnier, 2015/02/24
Re: Fixing ill-conditioned regular expressions. Proof of concept., Philipp Stephani, 2015/02/24