Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.4k views
in Technique[技术] by (71.8m points)

regex - Extract email from text usin notepad++ and regexp

I have a lot of text simmilar to this

Джамал Выбрать...АссистентБухгалтерВедущий специалистВладелецДокторДиректорЗаведующийЗам.директораГл.редакторГл.продавецГл.бухгалтерГен.директорГл.специалстИнженерКадровикПомощникПродавецПоварМенеджерНачальник отделаУправляющийУчредитель 923 230 24 54 922 009 72 00 [email protected]

I only need the email from this line, so [email protected] How do i do this with notepad and regex?

I found this [A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4} But its not excatly wha tim looking for

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to add lowercase alphabets range inside the character class or turn on the case insensitive i modifier to match both upper and lowercase alphabets.

[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}

OR

(?i)[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}

DEMO


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...