Re: What is the regex for apostraphe in postgres?

From: "Torsten Grust" <teggy(at)fastmail(dot)com>
To: "Shaozhong SHI" <shishaozhong(at)gmail(dot)com>, pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: What is the regex for apostraphe in postgres?
Date: 2021-10-14 12:35:02
Message-ID: e0d3c0e0-2735-49ea-88e3-176f11324303@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)fastmail(dot)com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Metin Ulusinan 2021-10-14 13:42:23 Re: Fault with initcap
Previous Message David G. Johnston 2021-10-14 12:31:04 Re: What is the regex for apostraphe in postgres