I want to mask email address like below.
Input: [email protected]; [email protected]; [email protected];
Output: ts@gmail.com; hw@yahoo.co.in; i*i**@hotmail.com;
Below Regex is excluding domain part but masking all characters in first part, except first character.
input.replaceAll("(?<=.{1}).(?=[^@]*?@)","X");
like [email protected] to [email protected]
I wanted to print a character in middle of the local-part like [email protected]
FYI -
I want to get first and middle character (random middle character in case of even length(4/6/8 characters).
Like below.
[email protected] -> A & p characters
[email protected] --> B & t
[email protected] -> k&a or k&t