You are right, I also found the same behaviour when using e.g the UNIX sed
command.
Ingolf
On Mon, Aug 23, 2021 at 4:24 PM Francisco Olarte
wrote:
> Ingolf:
>
> On Mon, Aug 23, 2021 at 2:39 PM Markhof, Ingolf
> wrote:
> > Yes, When I use (\1)? instead of (\1)+, the expression is evaluated
> q
Ingolf:
On Mon, Aug 23, 2021 at 2:39 PM Markhof, Ingolf
wrote:
> Yes, When I use (\1)? instead of (\1)+, the expression is evaluated quickly,
> but it doesn't return what I want. Once a word is written, it is not subject
> to matching again. i.e.
> select regexp_replace( --> remove double entri
Argh...
Yes, When I use (\1)? instead of (\1)+, the expression is evaluated
quickly, but it doesn't return what I want. Once a word is written, it is
not subject to matching again. i.e.
select regexp_replace( --> remove double entries
'one,one,one,two,two,three,three',
'([^,]+)(,\1)?($|,)
Right. Considering a longer sequence of a's, "(a*)\1" allows a wide variety
of matches. But in fact, this is not what I was trying to use. I was more
looking at "(a)\1*" which shall match exactly what "a+" matches. As
matching is greedy, "(a)\1*" shall consume all a's in a sequence in one go,
just
"Markhof, Ingolf" writes:
> thank you very much for your reply. Actually, I was assuming all these
> regular expressions are based on the same core implementation.
They are not. There are at least three fundamentally different
implementation technologies (DFA, NFA, hybrid). Friedl's "Mastering
Thank you very much for all your proposals!
Ingolf
==
Verizon Deutschland GmbH - Sebrathweg 20, 44149 Dortmund, Germany - Amtsgericht
Dortmund, HRB 14952 - Geschäftsführer: Detlef Eppig - Vorsitzender des
Aufsichtsrats: France
Hi Tom,
thank you very much for your reply. Actually, I was assuming all these
regular expressions are based on the same core implementation.
Interestingly, this doesn't seem to be true...
I am also surprised that you say the (\1)+ subpattern is computationally
expensive. Regular expressions are