Search Postgresql Archives

how to replace last 4 digital phone number into star using regexp_replace?

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

 



hi, friends,
   Our phone number format is 11 digital, i want to replace last 4 digital into star, for example:
   Replace this string including 11 digital phone number: 
   '18910180000,13910180000,232,abc'
    into:
     '1891018****,1391018****,232,abc'
   I try to use:
   select regexp_replace('18910180000,13910180000,232,abc','[0-9]{7}(\d+)','****','g')
   But it doesn't work, it will return:
     "****,****,232,abc"
     Can anyone help me? Thanks a million!

Best Regards
peng

[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