Re: What is the regex for apostraphe in postgres?

From: Steve Midgley <science(at)misuse(dot)org>
To: Torsten Grust <teggy(at)fastmail(dot)com>
Cc: 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 15:19:17
Message-ID: CAJexoS+BhJec6e69WSRVnBL33E6OGGEA5hXY7ZUZMB+WGmN3jw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Oct 14, 2021 at 5:35 AM Torsten Grust <teggy(at)fastmail(dot)com> wrote:

> 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
>
>
>
I think it's helpful to clarify that "double apostrophe" means in this
context a single apostrophe twice (ie ' ' ), not the single character
"double apostrophe" (ie ")

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jian He 2021-10-17 08:36:47 Does PostgreSQL have a pseudo-column like "LEVEL" in Oracle
Previous Message Metin Ulusinan 2021-10-14 13:42:23 Re: Fault with initcap