Re: back references using regex

From: Peter Fein <pfein(at)pobox(dot)com>
To: Matthew Peter <survivedsushi(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: back references using regex
Date: 2005-09-08 19:07:16
Message-ID: 43208BE4.3060605@pobox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthew Peter wrote:
> That doesn't seem to work with digits
>
> SELECT substring('12.00.00.34' FROM $$((\d+)\.\2)$$);
> or
> SELECT substring('12.00.00.34' FROM $$((\w+)\.\2)$$);
>
> but works with strings
>
> SELECT substring('abc.foo.foo.xyz' FROM
> $$((\w+)\.\2)$$);
>
> What I basically want to do is have a slice function
> like Python, where I can slice out items from a \s, \.
> or \n\n separated list.

You could always just write it in pl/python...

--
Peter Fein pfein(at)pobox(dot)com 773-575-0694

Basically, if you're not a utopianist, you're a schmuck. -J. Feldman

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Schmidt 2005-09-08 19:08:22 Re: EMS PostgreSQL Manager vs. TheKompany DataArchitect
Previous Message Cristian Prieto 2005-09-08 18:16:36 Re: Email Verfication Regular Expression