所有逃脱的一切正则排除组(\ r,\ n)
我尝试制作一条正则是从一些大文本文件中提取邮件地址。不幸的是,正则表达式也与逃脱的角色相匹配。我无法弄清楚如何配置这样的通用正则排除组。
REGEX:
([A-Za-z0-9]+[.\-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(.[A-Z|a-z]{2,})+
flags:“ simg”
示例文本:
<i><b>[email protected]</b></i></a>
ОМ ПО ЭЛ. ПОЧТЕ: \[email protected]\r.\r\nОМ ПО ЭЛ. ПОЧТЕ: \[email protected]\r.\r\n
ОМ ПО ЭЛ. ПОЧТЕ: \[email protected]\r.\r\nОМ ПО ЭЛ. ПОЧТЕ: \[email protected]\r.\r\n
REGEX匹配“ email&nbsp; >“而不是”
您可以在这里尝试一下我们: https://regex101.com/r/97imes/1
I try to make a regex to extract mail addresses from some big text files. Unfortunately the regex also matches on escaped characters. I can not figure out how to configure such a generic regex exclusion group.
Regex:
([A-Za-z0-9]+[.\-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(.[A-Z|a-z]{2,})+
Flags: "simg"
Example Text:
<i><b>[email protected]</b></i></a>
ОМ ПО ЭЛ. ПОЧТЕ: \[email protected]\r.\r\nОМ ПО ЭЛ. ПОЧТЕ: \[email protected]\r.\r\n
ОМ ПО ЭЛ. ПОЧТЕ: \[email protected]\r.\r\nОМ ПО ЭЛ. ПОЧТЕ: \[email protected]\r.\r\n
Regex matches "[email protected]" instead of "[email protected]".
You can try it our here: https://regex101.com/r/97ImeS/1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能的解决方案是以下解决方案,以防您想使用Python:
打印:
REGEX模式说明:
Possible solution is the following in case you wanna use python:
Prints:
Regex pattern explanation: