r/Python • u/luciferreeves • Sep 12 '22
Intermediate Showcase I hate regular expressions, so I built a library which makes it easier!
A few days ago, I built Edify, which allows you to build regular expressions in a programmatic way. It comes with pre-built common patterns (email, ip, phone, etc.) and a RegexBuilder class for your almost all your custom regex needs. I released v0.1.0 recently on PyPI and now, I am working on improvements. Will appreciate any inputs - issues or PRs if you got time or just a simple star for the repo would be very helpful.
Repo: https://github.com/luciferreeves/edify
PyPI: https://pypi.org/project/edify/
Complete Docs: http://edify.rtfd.io/
View all comments
Show parent comment
1
u/Rawing7 Sep 13 '22
You don't; you accept "a" in 4 places and reject it in 1. And the lookahead only asserts that at least 1 "a" exists. So your regex matches things like
aabaa.