一个正则bug

#2 · closed · 2 comments

View on GitHub ↗

woaiqiukui

EmailAll-master/common/utils.py中match_emails方法的正则存在bug,对"."前的字符数量匹配有偏差 reg_emails = re.compile(r"[a-zA-Z0-9][_|\.]*[a-zA-Z0-9]+@" + '[a-zA-Z0-9.-]*' + domain.replace('www.', '')) <img width="515" alt="image" src="https://user-images.githubusercontent.com/49117752/155474129-3edb1b7b-b466-4817-aa36-435ae4c955bc.png"> 在使用中可以发现存在明显错误 <img width="378" alt="image" src="https://user-images.githubusercontent.com/49117752/155474370-75491ae0-bf7d-48b8-8800-7d9632979b8a.png">

Comments

Taonn

> EmailAll-master/common/utils.py中match_emails方法的正则存在bug,对"."前的字符数量匹配有偏差 reg_emails = re.compile(r"[a-zA-Z0-9][_|.]_[a-zA-Z0-9]+@" + '[a-zA-Z0-9.-]_' + domain.replace('www.', '')) <img alt="image" width="515" src="https://user-images.githubusercontent.com/49117752/155474129-3edb1b7b-b466-4817-aa36-435ae4c955bc.png"> 在使用中可以发现存在明显错误 <img alt="image" width="378" src="https://user-images.githubusercontent.com/49117752/155474370-75491ae0-bf7d-48b8-8800-7d9632979b8a.png"> 感谢 我更新一下

Taonn

> EmailAll-master/common/utils.py中match_emails方法的正则存在bug,对"."前的字符数量匹配有偏差 reg_emails = re.compile(r"[a-zA-Z0-9][_|.]_[a-zA-Z0-9]+@" + '[a-zA-Z0-9.-]_' + domain.replace('www.', '')) <img alt="image" width="515" src="https://user-images.githubusercontent.com/49117752/155474129-3edb1b7b-b466-4817-aa36-435ae4c955bc.png"> 在使用中可以发现存在明显错误 <img alt="image" width="378" src="https://user-images.githubusercontent.com/49117752/155474370-75491ae0-bf7d-48b8-8800-7d9632979b8a.png"> 已更新!