pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Aaron Bono <postgresql@aranya.com>
Cc: Postgres SQL language list <pgsql-sql@postgresql.org>
Subject: Re: Regular Expression in SQL
Date: Sat, 15 Jul 2006 22:22:32 -0400
Message-ID: <25326.1153016552@sss.pgh.pa.us> (raw)
In-Reply-To: <bf05e51c0607151503j53fffb01y38840a72c43a50f6@mail.gmail.com>
References: <bf05e51c0607151503j53fffb01y38840a72c43a50f6@mail.gmail.com>

"Aaron Bono" <postgresql@aranya.com> writes:
> I thought by using the FOR '#' I could specify exactly what part of the
> expression I would get but it still grabs the first (...) of the pattern.

Hmm ... I think that this is a bug in similar_escape(): it ought to
transform parentheses in a SIMILAR pattern into non-capturing parentheses.

Until this is fixed, your best bet is to use the POSIX-regexp form of
substring().  You can't sneak non-capturing parens through
similar_escape, because it'll try to escape the ? ...

			regards, tom lane



view thread (2+ messages)

Message-ID: <25326.1153016552@sss.pgh.pa.us>
Permalink:  ../25326.1153016552@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25326.1153016552@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, postgresql@aranya.com
  Subject: Re: Regular Expression in SQL
  In-Reply-To: <25326.1153016552@sss.pgh.pa.us>

* 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