I want to replace letter of even indexes with asterisk (*) in my email username before @ sign using Regular expression.
I made regex but it is once work with even or work with odd length of username in email.
I want a single regex to handle both the expression First letter must visible all the time in given email.
Please help using regex.
Example: username@example.com
Regex: Works with odd length username input Expression: (?!^).(?=([^.]([a-zA-Z0-9]{2})*)@)
Input : username1@example.com
Output: u*e*n*m*1@example.com
Regex: Works with Even length username input Expression: (?!^).(?=(([a-zA-Z0-9]{2})*)@)
Input : username@example.com
Output: u*e*n*m*@example.com
But I want a single expression for both kind of username length email.
Thanks in advance.
