-
Notifications
You must be signed in to change notification settings - Fork 74
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
StackOverflowError from pattern input #56
Comments
Which means it tries to sort ALL of the generated matches. Your regex is infinite (it has the Kleene star), so ofc you get a SO. The solution is to use the lazy String pattern = "^[a-zA-Z\\s]*$";
Generex generex = new Generex(pattern);
final Iterator matchesGenerator = generex.iterator();
if (matchesGenerator.hasNext()) {
String firstMatch = matchesGenerator.next();
System.out.println(firstMatch); // ^\t$
} The output is however probably not what you wanted, because |
Thank you for explaining what's happening with this input. |
Thank you so much for making this tool!
When testing it, I ran into this case that causes a stack overflow:
And when that code is run I get this exception:
Could this be fixed?
The text was updated successfully, but these errors were encountered: