How to extract email id from text using Python regular expression?

PythonServer Side ProgrammingProgramming

The following code using Python regex extracts the email id from given string/text

Example

import re
s ='manogna@tutorialspoint.com56'
result =re.findall('[a-zA-Z0-9]\S*@\S*[a-zA-Z]', s)
print result

Output

This gives the output

['manogna@tutorialspoint.com']
raja
Published on 11-Jan-2018 08:46:09
Advertisements