我想在 Dart 中使用正则表达式来屏蔽电子邮件地址。
例如,我有电子邮件地址 [email protected],我想把它屏蔽成 s********@*********m
我有这个代码
String e = "[email protected]";
print(e.replaceAll(RegExp(r'(?<=.)[^@](?=[^@]*?@)|(?:(?<=@.)|(?!^)\\G(?=[^@]*$)).(?!$)'),'*'));
但是输出是 s********@m*il.com