Regex for email showing the first and last letters of the user and domain [duplicate]
I am new to regex and I am trying to substitute some characters for asterisk in php like below: email: [email protected] -> v****r@g***l.com I have done this: $email = preg_replace('/(?:^|@).\K|\.[^@]*$(*SKIP)(*F)|.(?=.*?\.)/', '*', $linha['cli_email']); The problem is that the output is v*****@g****.com instead of v****r@g***l.com and I don't know how to show the last for the username and last for the email provider.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.