Re: regexp_replace weirdness amounts to a bug?

From: Malthe <mborch(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: regexp_replace weirdness amounts to a bug?
Date: 2023-08-16 09:09:05
Message-ID: CAAPh5F=-UBp3Bm2qL9A1DaOWq3pCF+5fw8DLw4KONhqMBFXZPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Erik,

The regexp doesn't match your string because you're not allowing for
any repeat characters, try adding a '+'.

On Wed, 16 Aug 2023 at 09:07, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
>
> Hello,
>
> The following surprised me enough to think it might be a bug:
> (17devel)
>
> select
> regexp_replace('Abc Def'
> , '([a-z]) ([A-Z])'
> , '\1 ' || lower('\2') );
>
> regexp_replace
> ----------------
> Abc Def
> (1 row)
>
> -- 'Abc Def' got
> -- 'Abc def' expected
>
> What do you think?
>
> Thanks,
>
> Erik Rijkers
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2023-08-16 09:11:47 Re: Normalization of utility queries in pg_stat_statements
Previous Message Erik Rijkers 2023-08-16 09:09:02 regexp_replace weirdness amounts to a bug?