how to replace last 4 digital phone number into star using regexp_replace? - Mailing list pgsql-general

From sunpeng
Subject how to replace last 4 digital phone number into star using regexp_replace?
Date
Msg-id CAOYKhLpg_OZP=HxYq2b8nG0JMwteSZjVJzOKWjm+hJDSW+0mYw@mail.gmail.com
Whole thread Raw
Responses Re: how to replace last 4 digital phone number into star using regexp_replace?  (Michail Shurutov <m.shurutov@postgrespro.ru>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Moreno Andreo
Date:
Subject: Re: [SPAM] Re: Streaming Replica Master-Salve Config.
Next
From: Michail Shurutov
Date:
Subject: Re: how to replace last 4 digital phone number into star using regexp_replace?