Re: [GENERAL] regexp_replace puzzle

2010-03-10 Thread David W Noon
On Wed, 10 Mar 2010 13:41:54 +0100, Harald Fuchs wrote about [GENERAL] regexp_replace puzzle: [snip] > SELECT val, > regexp_replace(val, > '^(.*\W)?(C\d{7}|[DI]\d{6}|S\d{10})(\W.*)?$', > '\1' || '»\2«='|| sha224enc('\2&#

Re: [GENERAL] regexp_replace puzzle

2010-03-10 Thread Osvaldo Kussama
2010/3/10 Harald Fuchs : > I've got a problem with regexp_replace which I could reduce to the following: > >  CREATE FUNCTION digest(text, text) RETURNS bytea >      LANGUAGE c IMMUTABLE STRICT >      AS '$libdir/pgcrypto', 'pg_digest'; > >  CREATE FUNCTION sha224enc(text) RETURNS text AS $$ >  BEG

[GENERAL] regexp_replace puzzle

2010-03-10 Thread Harald Fuchs
I've got a problem with regexp_replace which I could reduce to the following: CREATE FUNCTION digest(text, text) RETURNS bytea LANGUAGE c IMMUTABLE STRICT AS '$libdir/pgcrypto', 'pg_digest'; CREATE FUNCTION sha224enc(text) RETURNS text AS $$ BEGIN RAISE WARNING 'arg=»%«', $1