Search Postgresql Archives

maybe incorrect regexp_replace behavior in v8.3.4 ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

 

 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux