如何通过正则表达式从电子邮件行中的 @ 之前删除以下任何不属于的字符?
我尝试了以下方法,但没有效果:(
找什么:^([^a-z0-9;:]*)([a-z0-9]*)(?1)(.*?[;:].+$)
用。。。来代替:$2$3
@ 之前任意位置要保留的字符:
| Letters | Numbers | - | _ | . |
采样线:
[email protected]:Testing1
[email protected]:tEsting1
m#[email protected]:teSting1
m4y.tes([email protected]:tesTing1
my.5test\@gmail.com:testIng1
my-tes6([email protected]:testiNg1
[email protected]:testinG1
&my_t%[email protected]:TestinG1
所需结果:
[email protected]:Testing1
[email protected]:tEsting1
[email protected]:teSting1
[email protected]:tesTing1
[email protected]:testIng1
[email protected]:testiNg1
[email protected]:testinG1
[email protected]:TestinG1