Created
November 24, 2023 14:08
-
-
Save jabranr/1c9f50c2793b01a830c89f379a5feec7 to your computer and use it in GitHub Desktop.
Redact an email address with asterisks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redactedEmail = email.replace(/(.{2})(.*)(@.*)/, '$1...$3'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment