0
I have this string emails="red23@gmail.com23sed27@hotmail.com78drt88@outlook.es" how can I extract only the emails with regex
Hola can I solve this using regular expressions ?
4 Réponses
+ 3
try the regex to find the mail with positive lookahed.
(?=@) it;ll look for @ after the match.
ex.
^([0-9]+)(?=a)
will match
96698569abcf
68536afhom
but not
686bcs
0
emails="red23@gmail.com23sed27@hotmail.co.uk78drt88@outlook.es"
import re
print(re.findall(r"\w+@[a-z]+(?:\.[a-z]{2,4})+", emails))
0
Thank u all guys. You are awesome.
- 1
hi