Quantcast
Channel: Regular expression for email masking - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Wiktor Stribiżew for Regular expression for email masking

Update with various masking email solutionsfoo@bar.com⇒f**@b**.com (current question) - s.replaceAll("(?<=.)[^@](?=[^@]*?@)|(?:(?<=@.)|(?!^)\\G(?=[^@]*$)).(?=.*\\.)", "*") (see the regex...

View Article



Answer by Chuancong Gao for Regular expression for email masking

How about this one if you do not need the masks having the same number of characters of the original strings (which is more anonymous):(?<=^.)[^@]*|(?<=@.).*(?=\.[^.]+$)For example, if you...

View Article

Regular expression for email masking

I am trying to write a regular expression to mask an email address. Example below.input: john.doe@example.en.comoutput: j*******@e*********.comI have tried the following but I just can't seem to get it...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images