maybe incorrect regexp_replace behavior in v8.3.4 ?

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: maybe incorrect regexp_replace behavior in v8.3.4 ?
Date: 2012-05-16 13:54:23
Message-ID: 0AD01C53605506449BA127FB8B99E5E10F18731A@FMSMSX105.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi:

bi_hsx_a0_latest=# select regexp_replace('xxx','^xxx$','abc');
regexp_replace
----------------
abc
(1 row)
expected behavior because there's a match

bi_hsx_a0_latest=# select regexp_replace('xxx','^xxxy$','abc');
regexp_replace
----------------
xxx
(1 row)
expected because there is no match (the 'y' in 'xxxy')

bi_hsx_a0_latest=# select regexp_replace('xxx','^xxxy$',null);
regexp_replace
----------------

(1 row)
But why did it return null in this case? I would think no match would leave it 'xxx'.

Thanks in Advance for any help and/or explanation.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vibhor Kumar 2012-05-16 14:08:02 Re: casting behavior of oids and relation names
Previous Message Tom Lane 2012-05-16 13:32:48 Re: casting behavior of oids and relation names