Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowRegexes is not working properly #11

Open
severindellsperger opened this issue Jul 10, 2020 · 1 comment
Open

allowRegexes is not working properly #11

severindellsperger opened this issue Jul 10, 2020 · 1 comment

Comments

@severindellsperger
Copy link

Hi @asweigart, Hi @ALL,

I recently found a bug (or at least a documentation gap) in this module.
For test purposes, I wrote an input validation where the user has to type in a password with a specific pattern (allowed symbols and minimal/maximal length). If I only use the allowRegex parameter it isn't working properly:
code:

password = pyip.inputStr(prompt='Type in your password: ', allowRegexes=[r"[A-Za-z0-9-_]{6,18}"], blockRegexes=[r"."])

log:

Type in your password: $hort

It's only working, if the blockRegex is set too:
code:

password = pyip.inputStr(prompt='Type in your password: ', allowRegexes=[r"[A-Za-z0-9-_]{6,18}"], blockRegexes=[r"."])

log:

Type in your password: $short
This response is invalid.

Maybe the code has to be updated or the documentation has to be changed.

Thanks.

Kind Severin

@brtduvally
Copy link

Thank you, @severindellsperger! I was having this issues too, and I would never have figured it out if you hadn't posting this issue.

+1 for fixing or at least the doc update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants