solution:[a-zA-Z0-9.!#$%&'*+-/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)* is a good choice
I am using a regular expression like the below to match email addresses in a file:
email = re.search('(\w+-*[.|\w]*)*@(\w+[.])*\w+',line)
When used on a file like the following, my regular expression works well:
mlk407289715@163.com huofenggib wrong in get_gsid
mmmmmmmmmm776@163.com rouni816161 wrong in get_gsid
But when I use it on a file like below, my regular expression runs unacceptably slowly:
9b871484d3af90c89f375e3f3fb47c41e9ff22 mingyouv9gueishao@163.com
e9b845f2fd3b49d4de775cb87bcf29cc40b72529e mlb331055662@163.com
And when I use the regular expression from this website, it still runs very slowly.
I need a solution and want to know what's wrong.