# No results when using (?-i) to search

**URL:** <https://forums.ankiweb.net/t/no-results-when-using-i-to-search/45457>\
**Category:** Help\
**Created:** [June 1, 2024, 8:34am UTC](https://forums.ankiweb.net/t/no-results-when-using-i-to-search/45457 "2024-06-01T08:34:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xka](https://avatars.discourse-cdn.com/v4/letter/x/58f4c7/32.png) [@xka](https://forums.ankiweb.net/u/xka)\
**Post date:** [June 1, 2024, 8:34am UTC](https://forums.ankiweb.net/t/no-results-when-using-i-to-search/45457/1 "2024-06-01T08:34:17Z")

</div>

A trivial search in the browser using `re:(?-i)a` is automatically changed to `re: (?-i) a` (note the inserted white space) and returns zero results. Any idea what’s going wrong? (Both the simple search `a` and `re:a` return many results, many of them matching the lower case.)

---

<div class="post-metadata">

**Author:** ![xka](https://avatars.discourse-cdn.com/v4/letter/x/58f4c7/32.png) [@xka](https://forums.ankiweb.net/u/xka)\
**Post date:** [June 1, 2024, 8:36am UTC](https://forums.ankiweb.net/t/no-results-when-using-i-to-search/45457/2 "2024-06-01T08:36:20Z")

</div>

Fixed by putting quotes around the search string: `"re:(?-i)a"` works as expected. Possibly an old bug, sorry (I’m on Anki 2.1.54).

---

<div class="post-metadata">

**Author:** ![Rumo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rumo/32/1505_2.png) [@Rumo](https://forums.ankiweb.net/u/Rumo)\
**Post date:** [June 1, 2024, 9:15am UTC](https://forums.ankiweb.net/t/no-results-when-using-i-to-search/45457/3 "2024-06-01T09:15:24Z")

</div>

It’s actually not a bug. Parentheses are special characters that delimit groups. If you want to include literal ones, e.g. to pass them into a regex, they need to be [escaped](https://docs.ankiweb.net/searching.html#matching-special-characters).

It might have been more convenient to only treat parentheses as special characters at word boundaries, but now this is unlikely to change for compatibility reasons.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [July 1, 2024, 9:16am UTC](https://forums.ankiweb.net/t/no-results-when-using-i-to-search/45457/4 "2024-07-01T09:16:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
