pip install kmatch
python
import kmatch
python
matcher = kmatch.Matcher()
python
matcher.add("email", "[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+")
python
text = "Please contact me at john@example.com for further information."
matches = matcher.match(text)
for match in matches:
print(match.name, match.text)