Re: Possible RegEx bug for lower-case a and s characters - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Possible RegEx bug for lower-case a and s characters
Date
Msg-id CAKFQuwb=zb6wou7wQ2PjaoHXqVBKH=rs3CVXW0wTdfdEDmKfVA@mail.gmail.com
Whole thread Raw
In response to Possible RegEx bug for lower-case a and s characters  ("DeFreitas, Nigel" <nigel.defreitas@verisk.com>)
List pgsql-bugs


On Thu, Nov 17, 2022 at 4:00 AM DeFreitas, Nigel <nigel.defreitas@verisk.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.

pgsql-bugs by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: WAL segments removed from primary despite the fact that logical replication slot needs it.
Next
From: Masahiko Sawada
Date:
Subject: Re: WAL segments removed from primary despite the fact that logical replication slot needs it.