Re: Why this regexp matches?! - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Why this regexp matches?!
Date
Msg-id 20120206114853.GA13214@depesz.com
Whole thread Raw
In response to Re: Why this regexp matches?!  (Jasen Betts <jasen@xnet.co.nz>)
List pgsql-general
On Mon, Feb 06, 2012 at 11:29:23AM +0000, Jasen Betts wrote:
> On 2012-02-04, hubert depesz lubaczewski <depesz@depesz.com> wrote:
> > select 'depesz depeszx depesz' ~ E'^(.*)( \\1)+$';
> >
> > what's worse:
> > $ select regexp_replace( 'depesz depeszx depesz', E'^(.*)( \\1)+$', E'\\1' );
> >  regexp_replace
> > ────────────────
> >  depesz
> > (1 row)
> >
> > I know that Pg regexps are limited, but even grep's regexps match this
> > correctly:
>
> whose grep?
>
> Postgres is BSD licence and that means they can't use the latest and
> greatest GPL libraries.

yes, I did use gnu grep. but it's hardly "latest and greatest" - there
is nothing very special about this regexp, aside from the fact, that
according to pg docs (how I read them) - it shouldn't match, but it
does.

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: Why extract( ... from timestamp ) is not immutable?
Next
From: Pat Heuvel
Date:
Subject: Re: vacuumlo fails pgsql ver 8.3