Non-capturing expressions

From: Thom Brown <thom(at)linux(dot)com>
To: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Non-capturing expressions
Date: 2014-10-25 09:24:29
Message-ID: CAA-aLv5jhbhqO7cAVoLei0cSMF15t9+GJGF9k1GB8dyzVEFyAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

It must be that I haven't had enough caffeine today, but I can't figure out
why the following expression captures the non-capturing part of the text:

# SELECT regexp_matches('postgres','(?:g)r');
regexp_matches
----------------
{gr}
(1 row)

I'm expecting '{r}' in the output as I thought this would use ARE mode by
default.

Thom

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2014-10-25 09:31:48 Re: Emulating flexible regex replace
Previous Message Adrian Klaver 2014-10-25 02:21:56 Re: Osx stopping to install