How to desensitize a string that displays only the first two bits of the same character

has a mailbox with an extreme name: zzzzzzzzzz@qq.com
now wants to replace the characters between @ except the first two digits with *. How do you do that?
because the account part is exactly the same, so:

   

Jan.11,2022

x.replace (/ (? < = [\ w\ d] {2}) [\ w\ d] (? = @) /, " *")


if the quantity of * does not require the same number as the replaced part

'zzzzzzzzzz@qq.com'.replace(/(.{2})(.*)(@.+)/g, '$1****$3')

if the quantity is required to be the same

// 2018/12/06 Fix
'zzzzzzzzzz@qq.com'.replace(/(.{2})(.*)(@.+)/g, function($0, $1, $2, $3){return $1+(Array.apply(null, {length:$2.length+1}).join('*'))+$3;});

//  @_@ ,RegExp  
'zzzzzzzzzz@qq.com'.replace(/(.{2})(.*)(@.+)/g, RegExp.$1+(Array.apply(null, {length:RegExp.$2.length+1}).join('*'))+RegExp.$3);

the answer to @ Curry 61 upstairs can also be

.
Menu