On Wed, 10 Mar 2010 13:41:54 +0100, Harald Fuchs wrote about regexp_replace puzzle: [snip] > SELECT val, > regexp_replace(val, > '^(.*\W)?(C\d{7}|[DI]\d{6}|S\d{10})(\W.*)?$', > '\1' || '»\2«='|| sha224enc('\2') || '\3', 'i') [snip] >i.e. the first '\2' gets properly expanded by the second paren match, >but the second '\2' doesn't get expanded. The second instance of '\2' is first passed to sha224enc(), then that function's result is passed to regexp_replace. -- Regards, Dave [RLU #314465] ======================================================================= david.w.noon@xxxxxxxxxxxx (David W Noon) ======================================================================= -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general