Having problem in masking Email

Hey Everyone,

I want to mask the email. I am using 

Syntax Editor Code Snippet

Regex_Replace(EmailValue,(?<=.).(?=[^@]*?@),*)


for eg:-

 if the input given is :-  john.doe@gmail.com

the output should be:-j*******@g****.com


THANKS in advance..

There is a stackoverflow post on this:

https://stackoverflow.com/questions/43003138/regular-expression-for-email-masking


The answer there is: 

(?<=^.)[^@]*|(?<=@.).*(?=\.[^.]+$)