Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqK2W-0006eh-Ck for pgsql-general@arkaria.postgresql.org; Thu, 16 Aug 2018 15:18:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fqK2U-0003Kx-Ip for pgsql-general@arkaria.postgresql.org; Thu, 16 Aug 2018 15:18:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqK2U-0003Kp-75 for pgsql-general@lists.postgresql.org; Thu, 16 Aug 2018 15:18:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqK2R-0007ae-E0 for pgsql-general@lists.postgresql.org; Thu, 16 Aug 2018 15:18:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7GFI9Wo013259; Thu, 16 Aug 2018 11:18:09 -0400 From: Tom Lane To: Andreas Joseph Krogh cc: Adrian Klaver , pgsql-general@lists.postgresql.org Subject: Re: Sv: Re: Sv: Re: regex match and special characters In-reply-to: References: Comments: In-reply-to Andreas Joseph Krogh message dated "Thu, 16 Aug 2018 16:47:15 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <13257.1534432689.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 16 Aug 2018 11:18:09 -0400 Message-ID: <13258.1534432689@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andreas Joseph Krogh writes: > When using E-syntax you need to double the backslash for escaping: > andreak@[local]:5433 10.4 andreak=# select 'abcd'||chr(8198) ~ E'abcd\\s'; Another thing to keep in mind is that this is all locale-dependent (specifically, LC_CTYPE, I believe). In plain old C locale, nothing beyond the standard ASCII whitespace characters will match \s. I'm not sure how universal it is for other locales to treat characters like U+2006 as whitespace. regards, tom lane