From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: pgsql-bugs@lists.postgresql.org
To: koglep@gmail.com
Subject: Re: BUG #15069: group by after regexp_replace
Date: Thu, 15 Feb 2018 15:34:59 +0000
Message-ID: <87fu62qngv.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <151870768979.1393.4103488163602755553@wrigleys.postgresql.org>
References: <151870768979.1393.4103488163602755553@wrigleys.postgresql.org>
>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:
PG> select upper(regexp_replace(a, '\\s+', '')) as keyword
This regexp doesn't do what you seem to be expecting. With
standard_conforming_strings enabled, which is the default, \ is not a
special character to the string literal parser, so the regexp engine is
seeing a regexp of \\s+ which means "match the literal character \
followed by one or more lowercase "s" characters". Accordingly the
regexp never matches on your input.
To remove whitespace use '\s+' or E'\\s+' or '[[:space:]]+'
--
Andrew (irc:RhodiumToad)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: andrew@tao11.riddles.org.uk, koglep@gmail.com
Subject: Re: BUG #15069: group by after regexp_replace
In-Reply-To: <87fu62qngv.fsf@news-spur.riddles.org.uk>
References: <151870768979.1393.4103488163602755553@wrigleys.postgresql.org> <87fu62qngv.fsf@news-spur.riddles.org.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox