# project: Treat replacement literally when dealing non-ASCII text search \(\#56123\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3fde4e285ea4d40ac7d6fcb75bb0357c4179b4e0

Requested commit: 3fde4e285ea4d40ac7d6fcb75bb0357c4179b4e0

Commit: 3fde4e285ea4d40ac7d6fcb75bb0357c4179b4e0

Tree: 7b1d4ab0368aed4a48cb076efd4f79eff8cf684a

Author: Xin Zhao

Committer: GitHub

## Message

```
project: Treat replacement literally when dealing non-ASCII text search (#56123)

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 is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #55503

In #28752, to support case-insensitive search for non-ASCII queries, Zed
internally falls back to a regex search. However, this also affected the
replacement behavior, as the replacement code implemented a simple match
logic:

https://github.com/zed-industries/zed/blob/dccea211edfed189db0704ef1247e446aca81150/crates/project/src/search.rs#L452-L457
Since the regex fallback is an internal implementation detail (the user
never enabled regex mode), the replacement should behave the same as a
normal text replacement. This PR fixes that.

Release Notes:

- Fixed replacement text being treated as a regex pattern when
performing case-insensitive text search with non-ASCII characters.
```

## Parents

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

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