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

Fix StackOverflowError in extra-long Text Block by using the possessive quantifier to avoid backtracking #84

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

nieldw
Copy link
Contributor

@nieldw nieldw commented Dec 8, 2020

Possessive quantifiers are a way to prevent the regex engine from trying all permutations. Because it is impossible that there can be another match with a - at the end of the input (it's all or nothing), it is pointless backtracking to find other possible matches.

See https://www.regular-expressions.info/possessive.html

…ve quantifier to avoid backtracking

Possessive quantifiers are a way to prevent the regex engine from trying all permutations. Because it is impossible that there can be another match with a `-` at the end of the input (it's all or nothing), it is pointless backtracking to find other possible matches.

See https://www.regular-expressions.info/possessive.html
@qoomon qoomon self-requested a review December 9, 2020 10:46
@qoomon qoomon added the bug label Dec 9, 2020
@qoomon
Copy link
Owner

qoomon commented Dec 9, 2020

Thanks a lot. LGTM I'll create a release later today

@qoomon qoomon merged commit 62ca00c into qoomon:master Dec 9, 2020
@qoomon
Copy link
Owner

qoomon commented Dec 9, 2020

released with version 1.4.5

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

Successfully merging this pull request may close these issues.

None yet

2 participants