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

Show off DFA's strength #5

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

ogregoire
Copy link

Usual implementations don't match failing branches very well while DFAs do that very well. Let's show that! See https://swtch.com/~rsc/regexp/regexp1.html

for (int i = 0; i < count; i++) {
result.append(str);
}
return result.toString;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be return result.toString()?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhztheplayer You're correct. I tested only the Java 11 version and wrote a fix for versions < 11 by hand without testing. That fix included a typo which you correctly noted. I fixed that typo.

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

Successfully merging this pull request may close these issues.

3 participants