Bump fancy-regex to v0.17.0 (#51549)

This fixes "Error compiling regex: Look-behind assertion without
constant size" when using variable-length lookbehinds in search, such as
`(?<=^(?:\s{4})*)\s{4}`.

fancy-regex 0.17.0 adds support for variable-length lookbehinds using
regex-automata's DFA reverse search commit:
https://github.com/fancy-regex/fancy-regex/commit/b58fb31

Closes #50219 

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed the error message on compilation of regular expressions
containing variable length lookbehind assertions

Previously:
<img width="1582" height="1377" alt="image"
src="https://github.com/user-attachments/assets/3e275891-aef5-482e-87f0-c47b9eac3c2a"
/>


Now:
<img width="1323" height="1015" alt="image"
src="https://github.com/user-attachments/assets/8638cd08-fcd0-40f9-8749-32e6352e89b7"
/>


Thanks to @vorahardik7 for helping out with a test example and
@AmaanBilwar for suggesting a fix!

Signed-off-by: Pratik Karki <pratik@prertik.com>
This commit is contained in:
Pratik Karki authored and GitHub committed 2026-03-18 20:38:20 +02:00
1 parent 3a98c67f36
commit a2f99b9e08
2 files changed
+15 -4

No files matched your search

Generated
+14 -3
View File
@@ -6184,6 +6184,17 @@ dependencies = [
"regex-syntax",
]
[[package]]
name = "fancy-regex"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72cf461f865c862bb7dc573f643dd6a2b6842f7c30b07882b56bd148cc2761b8"
dependencies = [
"bit-set",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "fast-srgb8"
version = "1.0.0"
@@ -9154,7 +9165,7 @@ dependencies = [
"bytecount",
"data-encoding",
"email_address",
"fancy-regex",
"fancy-regex 0.16.2",
"fraction",
"getrandom 0.3.4",
"idna",
@@ -13144,7 +13155,7 @@ dependencies = [
"dap",
"encoding_rs",
"extension",
"fancy-regex",
"fancy-regex 0.17.0",
"fs",
"futures 0.3.31",
"fuzzy",
@@ -17608,7 +17619,7 @@ dependencies = [
"anyhow",
"base64 0.22.1",
"bstr",
"fancy-regex",
"fancy-regex 0.16.2",
"lazy_static",
"regex",
"rustc-hash 1.1.0",
+1 -1
View File
@@ -556,7 +556,7 @@ emojis = "0.6.1"
env_logger = "0.11"
encoding_rs = "0.8"
exec = "0.3.1"
fancy-regex = "0.16.0"
fancy-regex = "0.17.0"
fork = "0.4.0"
futures = "0.3"
futures-concurrency = "7.7.1"