REGEXP: returning match?
Started by Jean-Christian Imbeaultover 23 years ago2 messagesgeneral
Re: REGEXP: returning match?
--- Jean-Christian Imbeault <jc@mega-bucks.co.jp>
wrote:
Is there a simple way to get psql to return the part
that match a query
containing a regexp?
CREATE FUNCTION str_capture(text, text) RETURNS text
AS '
$_[0] =~ m/($_[1])/;
return $1;
' LANGUAGE 'plperl';
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com