Re: Possible RegEx bug for lower-case a and s characters

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "DeFreitas, Nigel" <nigel(dot)defreitas(at)verisk(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Possible RegEx bug for lower-case a and s characters
Date: 2022-11-17 12:59:54
Message-ID: CAKFQuwb=zb6wou7wQ2PjaoHXqVBKH=rs3CVXW0wTdfdEDmKfVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Nov 17, 2022 at 4:00 AM DeFreitas, Nigel <nigel(dot)defreitas(at)verisk(dot)com>
wrote:

>
> *select* regexp_replace('Nigel DeFreit a s', E
> '[\s+|"]|[\n\r\f\a\t]|[^[:ascii:]]','','g') *AS* *result*;
>
>
>
Don't use E strings when writing regex. It adds a whole other layer of
backslash escaping that you really don't want to deal with.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Masahiko Sawada 2022-11-17 14:22:12 Re: WAL segments removed from primary despite the fact that logical replication slot needs it.
Previous Message hubert depesz lubaczewski 2022-11-17 10:26:57 Re: WAL segments removed from primary despite the fact that logical replication slot needs it.