pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Torsten Grust <teggy@fastmail.com>
To: Shaozhong SHI <shishaozhong@gmail.com>
To: pgsql-sql <pgsql-sql@lists.postgresql.org>
Subject: Re: What is the regex for apostraphe in postgres?
Date: Thu, 14 Oct 2021 14:35:02 +0200
Message-ID: <e0d3c0e0-2735-49ea-88e3-176f11324303@www.fastmail.com> (raw)
In-Reply-To: <CA+i5JwZ1B8LuqTnMOOAQjvYBq5x_4BYo6ToV9n5U_15p1hpXpw@mail.gmail.com>
References: <CA+i5JwZ1B8LuqTnMOOAQjvYBq5x_4BYo6ToV9n5U_15p1hpXpw@mail.gmail.com>

Hi David,

in a SQL string literal (or regular expression), an apostrophe is represented by '' (double apostrophe):

  SELECT 'foo''bar' SIMILAR TO '_+''_+';
  -> #t

Cheers,
  —T

On Thu, Oct 14, 2021, at 12:31, Shaozhong SHI wrote:
> Can we check whether a text string contains apostraphe ' of not?
> 
> Regards,
> 
> David

--
| Torsten Grust
| teggy@fastmail.com

view thread (4+ messages)  latest in thread

Message-ID: <e0d3c0e0-2735-49ea-88e3-176f11324303@www.fastmail.com>
Permalink:  ../e0d3c0e0-2735-49ea-88e3-176f11324303@www.fastmail.com/
Also on:    postgresql.org/message-id/e0d3c0e0-2735-49ea-88e3-176f11324303@www.fastmail.com

 · 

reply

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-sql@postgresql.org
  Cc: teggy@fastmail.com, shishaozhong@gmail.com
  Subject: Re: What is the regex for apostraphe in postgres?
  In-Reply-To: <e0d3c0e0-2735-49ea-88e3-176f11324303@www.fastmail.com>
  References: <CA+i5JwZ1B8LuqTnMOOAQjvYBq5x_4BYo6ToV9n5U_15p1hpXpw@mail.gmail.com> <e0d3c0e0-2735-49ea-88e3-176f11324303@www.fastmail.com>

* 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