Re: regexp_replace weirdness amounts to a bug?

Malthe <mborch@gmail.com>

From: Malthe <mborch@gmail.com>
To: Erik Rijkers <er@xs4all.nl>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-08-16T09:09:05Z
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@xs4all.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
>
>
>