-
Notifications
You must be signed in to change notification settings - Fork 43
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
Positive lookahead? #50
Comments
@santi77 - I think your pattern should be like: string pattern = "^(?.\\d)(?.[a-z])(?.[A-Z])(?.[@$\\._\\*#&%]).{8,16}$";
string value = new Xeger(pattern).Generate(); |
That works, thank you!!! |
I've my doubts if this actually works. Also when using Rex (https://rise4fun.com/rex), I get this error: So in your case, to generate a valid pattern, you can use like this: "\\d{2,4}[a-z]{2,4}[A-Z]{2,4}[0-9a-zA-Z]{2,4}" However this is not really random... |
This worked for me as well, but I don't understand why. The construct Looks like it's an issue with this lib. The first syntax works for validation ( Note also that |
I'm trying to get a random password with some restrictions, this is my regex
^(?=.\d)(?=.[a-z])(?=.[A-Z])(?=.[@$._*#&%]).{8,16}$
This regex says:
When I try to run this on Xeger the code hangs, It is possible to do this?
The text was updated successfully, but these errors were encountered: