PythonHost.ir | پایتون هاست
Фотография
нажмите — покажем
нажмите — покажем
آموزش Regex: استخراج ساده الگوهای شبیه ایمیل #پایتون
import re
text = "[email protected] test [email protected]"
pattern = r"[\w.+-]+@[\w.-]+\.[A-Za-z]{2,}"
print(re.findall(pattern, text))
# برای اعتبارسنجی واقعی ایمیل، Regex ساده کافی نیست.
pythonhost.ir | پایتون هاست
@pythonhost_ir
29 ·