Re: Bizarre behavior of \w in a regular expression bracket construct

Joel Jacobson <joel@compiler.org>

From: "Joel Jacobson" <joel@compiler.org>
To: "Tom Lane" <tgl@sss.pgh.pa.us>, "Alvaro Herrera" <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2021-02-21T18:27:25Z
Lists: pgsql-hackers
On Sun, Feb 21, 2021, at 18:39, Tom Lane wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > This one I didn't understand:
> >> ^([\W])$   | pg     |
> 
> I think Joel just forgot to mark that as ERROR. 

Yes, my mistake, sorry about that,
(I manually edited the query result and replaced empty-field with "ERROR").

(I see I also forgot to mark the ones in the first ASCII part
of the email as ERROR, which should have been the
ones with an empty field for engine "pg".)

/Joel

Commits

  1. Doc: remove src/backend/regex/re_syntax.n.

  2. Change regex \D and \W shorthands to always match newlines.

  3. Allow complemented character class escapes within regex brackets.