Re: regexp question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andy Kriger" <akriger(at)greaterthanone(dot)com>
Cc: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: regexp question
Date: 2003-02-22 02:59:49
Message-ID: 2305.1045882789@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Andy Kriger" <akriger(at)greaterthanone(dot)com> writes:
> I see that it's possible to select using regexps.
> Is it possible to use portions of the selection in the result?

The POSIX version of substring() might do what you want:
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/functions-matching.html#FUNCTIONS-POSIX-REGEXP
I forget whether that's available in any version before 7.3.

If not, the next step would be to write a little function in plperl or
pltcl to mash the string however you want ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2003-02-22 03:05:46 Re: What filesystem?
Previous Message Tom Lane 2003-02-22 02:56:02 Re: How to update rows from a cursor in PostgreSQL