Re: Inside the Regex Engine - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Inside the Regex Engine
Date
Msg-id 3FCE0596.2010307@dunslane.net
Whole thread Raw
In response to Re: Inside the Regex Engine  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

>david@fetter.org (David Fetter) writes:
>  
>
>>While PL/Perl is great, it's not available everywhere, and I'd like to
>>be able to grab atoms from a regex match in, say, a SELECT.  Is there
>>some way to get access to them?
>>    
>>
>
>There's a three-parameter variant of substring() that allows extraction
>of a portion of a regex match --- unfortunately it uses SQL99's
>brain-dead notion of regex, which will not satisfy any Perl weenie :-(
>
>I think it'd be worth our while to define some comparable functionality
>that depends only on the POSIX regex engine ...
>  
>

substitute should be relatively straightforward, I guess; split and 
match maybe less so - what do you return? An array? Or you could require 
an explicit subscript to get a particular return value as in 
split_part(), which would be potentially inefficient if you want more 
than one (although I guess results could be cached).

cheers

andrew



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Encoding problem with 7.4
Next
From: Stephan Szabo
Date:
Subject: Re: Encoding problem with 7.4