Re: How best to work around the issue - regex string cannot contain brackets - Mailing list pgsql-sql

From David G. Johnston
Subject Re: How best to work around the issue - regex string cannot contain brackets
Date
Msg-id CAKFQuwYbkOta7upAttZMRCBFVrLozMtygZ=jmWN41ad5C+BnKg@mail.gmail.com
Whole thread Raw
In response to Re: How best to work around the issue - regex string cannot contain brackets  (Christophe Pettus <xof@thebuild.com>)
Responses Re: How best to work around the issue - regex string cannot contain brackets  (Shaozhong SHI <shishaozhong@gmail.com>)
List pgsql-sql
On Thu, Feb 3, 2022 at 9:58 AM Christophe Pettus <xof@thebuild.com> wrote:


> On Feb 3, 2022, at 08:53, Shaozhong SHI <shishaozhong@gmail.com> wrote:
>
> One would consider the following would work, but it did not because the brackets.
> select regexp_matches('Department for Transport (Parking)', 'Department for Transport (Parking)', 'g')
>
> Can anyone enlighten me?

Have you tried reading a book or some tutorials on RegExes?  I'll admit our documentation is probably not the best resource out there to actually learn the language.


You escape the ()s with a backslash:


David J.

pgsql-sql by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: How best to work around the issue - regex string cannot contain brackets
Next
From: aditya desai
Date:
Subject: Re: Increase fetch fize of oracl_fdw(ALTER SERVER)