# Respect regex assertions more faithfully with search \(\#62158\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1ade7854f224512dcff21da2d47b5ad01b73d9b0)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1ade7854f224512dcff21da2d47b5ad01b73d9b0

Requested commit: 1ade7854f224512dcff21da2d47b5ad01b73d9b0

Commit: 1ade7854f224512dcff21da2d47b5ad01b73d9b0

Tree: 1040e9a6bfe5e28c27ee03b2611f51706e28ba06

Author: Piotr Osiewicz

Committer: GitHub

## Message

```
Respect regex assertions more faithfully with search  (#62158)

- **project_search: Add failing test for regex searches with
assertions**
- **project_search: Improve handling of regex assertions**

# Objective

Fixes #55995 by removing a faulty optimization path for regex searches.


## Solution

## Testing

We've added 3 extra tests for the changed behavior.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

> This section is optional. If this PR does not include a visual change
or does not add a new user-facing feature, you can delete this section.

- Help others understand the result of this PR by showcasing your
awesome work!
- If this PR includes a visual change, consider adding a screenshot,
GIF, or video
- A before/after comparison is very useful for changes to existing
features!

While a showcase should aim to be brief and digestible, you can use a
toggleable section to save space on longer showcases:

<details>
  <summary>Click to view showcase</summary>

My super cool demos here

</details>

---

Release Notes:

- Improved handling of regexes in project/buffer searches

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

- [184e124bba43220e1e39f73ff63f563fc8f27c76](https://git.cafe/gitcafe/zed/commit/184e124bba43220e1e39f73ff63f563fc8f27c76?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1ade7854f224512dcff21da2d47b5ad01b73d9b0?format=markdown)
