regex from plperl - Mailing list pgsql-general

From Ferruccio Zamuner
Subject regex from plperl
Date
Msg-id E18SD8R-0006iV-00@global.dnsprotect.com
Whole thread Raw
Responses Re: regex from plperl  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
--


pgsql-general by date:

Previous
From: "Ed L."
Date:
Subject: 7.3.1: test select_having ... FAILED
Next
From: "Ed L."
Date:
Subject: missing 7.3.1 pg_hba.conf examples