regex from plperl

From: "Ferruccio Zamuner" <nonsolosoft(at)diff(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: regex from plperl
Date: 2002-12-28 09:19:59
Message-ID: E18SD8R-0006iV-00@global.dnsprotect.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I've written following function:

create or replace function dewey(text)
returns text
as '
$_=shift;
if (/(\d\d\d)/) {
return "$1";
} else {
return("this is not a valid dewey!");
}' language plperlu;

Then:

libri=# select dewey('432');
dewey
----------------------------
this is not a valid dewey!
(1 row)

It seems that regex doesn't work at all.

But regex are quite important for me.
Is There something that I've forgotten?

Best wishes, \fer
--

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ed Loehr 2002-12-28 09:23:22 missing 7.3.1 pg_hba.conf examples
Previous Message Ed L. 2002-12-28 08:08:42 7.3.1: test select_having ... FAILED