-
Notifications
You must be signed in to change notification settings - Fork 488
Look-behinds [1 / 6]: regex-syntax support #1315
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
Open
shilangyu
wants to merge
4
commits into
rust-lang:master
Choose a base branch
from
epfl-systemf:lb/syntax
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ConradIrwin
added a commit
to zed-industries/zed
that referenced
this pull request
Dec 4, 2025
Fancy regex has a max backtracking limit which defaults to 1,000,000 backtracks. This avoids spinning the CPU forever in the case that a match is taking a long time (though does mean that some matches may be missed). Unfortunately the verison we depended on causes an infinite loop when the backtracking limit is hit (fancy-regex/fancy-regex#137), so we got the worse of both worlds: matches were missed *and* we spun the CPU forever. Updating fixes this. Excitingly, in the future, regex may gain support for lookarounds (rust-lang/regex#1315), which will make fancy-regex much less load bearing. Closes #43821
ConradIrwin
added a commit
to zed-industries/zed
that referenced
this pull request
Dec 4, 2025
Fancy regex has a max backtracking limit which defaults to 1,000,000 backtracks. This avoids spinning the CPU forever in the case that a match is taking a long time (though does mean that some matches may be missed). Unfortunately the verison we depended on causes an infinite loop when the backtracking limit is hit (fancy-regex/fancy-regex#137), so we got the worse of both worlds: matches were missed *and* we spun the CPU forever. Updating fixes this. Excitingly regex may gain support for lookarounds (rust-lang/regex#1315), which will make fancy-regex much less load bearing. Closes #43821 Release Notes: - Fix a bug where search regexes with look-around or backreferences could hang the CPU. They will now abort after a certain number of match attempts.
AlpSha
pushed a commit
to AlpSha/zed
that referenced
this pull request
Dec 5, 2025
Fancy regex has a max backtracking limit which defaults to 1,000,000 backtracks. This avoids spinning the CPU forever in the case that a match is taking a long time (though does mean that some matches may be missed). Unfortunately the verison we depended on causes an infinite loop when the backtracking limit is hit (fancy-regex/fancy-regex#137), so we got the worse of both worlds: matches were missed *and* we spun the CPU forever. Updating fixes this. Excitingly regex may gain support for lookarounds (rust-lang/regex#1315), which will make fancy-regex much less load bearing. Closes zed-industries#43821 Release Notes: - Fix a bug where search regexes with look-around or backreferences could hang the CPU. They will now abort after a certain number of match attempts.
CherryWorm
pushed a commit
to CherryWorm/zed
that referenced
this pull request
Dec 16, 2025
Fancy regex has a max backtracking limit which defaults to 1,000,000 backtracks. This avoids spinning the CPU forever in the case that a match is taking a long time (though does mean that some matches may be missed). Unfortunately the verison we depended on causes an infinite loop when the backtracking limit is hit (fancy-regex/fancy-regex#137), so we got the worse of both worlds: matches were missed *and* we spun the CPU forever. Updating fixes this. Excitingly regex may gain support for lookarounds (rust-lang/regex#1315), which will make fancy-regex much less load bearing. Closes zed-industries#43821 Release Notes: - Fix a bug where search regexes with look-around or backreferences could hang the CPU. They will now abort after a certain number of match attempts.
someone13574
pushed a commit
to someone13574/zed
that referenced
this pull request
Dec 16, 2025
Fancy regex has a max backtracking limit which defaults to 1,000,000 backtracks. This avoids spinning the CPU forever in the case that a match is taking a long time (though does mean that some matches may be missed). Unfortunately the verison we depended on causes an infinite loop when the backtracking limit is hit (fancy-regex/fancy-regex#137), so we got the worse of both worlds: matches were missed *and* we spun the CPU forever. Updating fixes this. Excitingly regex may gain support for lookarounds (rust-lang/regex#1315), which will make fancy-regex much less load bearing. Closes zed-industries#43821 Release Notes: - Fix a bug where search regexes with look-around or backreferences could hang the CPU. They will now abort after a certain number of match attempts.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is the first out of six PRs aiming to bring look-behinds to rust-regex. See #1266 for more information, notably the implementation plan.
In this PR we focus on adding look-behind support to the regex-syntax crate. New additions are hidden behind a feature flag to not break compatibility with other crates.
Currently the CI fails on generation of docsrs. This is due to all features being enabled during generation which breaks regex-automata. This will be fixed in the second PR which works on regex-automata.