# I get false positives in the Browser when searching with regex

**URL:** <https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094>\
**Category:** Help\
**Created:** [June 2, 2025, 8:10pm UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094 "2025-06-02T20:10:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![twhanson1](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@twhanson1](https://forums.ankiweb.net/u/twhanson1)\
**Post date:** [June 2, 2025, 8:10pm UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/1 "2025-06-02T20:10:55Z")

</div>

I get several false positives on browser searches using regular expressions. As per the Anki manual, a search:of Country:re:- should yield a list of all my notes where the Country field has a dash “-”. It does that but in addition it yeads several notes where this fiel does not have a “-”. Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [June 2, 2025, 11:22pm UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/2 "2025-06-02T23:22:09Z")

</div>

Can you provide some examples of the “Country” Field contents for the false positives? Preferably, the HTML source.

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [June 2, 2025, 11:38pm UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/3 "2025-06-02T23:38:20Z")

</div>

> [@Eltaurus](#):
>
> Preferably, the HTML source.

_Definitely_ the HTML – since there’s so much of CSS that uses `-`'s. You can see that underlying HTML by clicking `< >` above the field.

---

<div class="post-metadata">

**Author:** ![twhanson1](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@twhanson1](https://forums.ankiweb.net/u/twhanson1)\
**Post date:** [June 3, 2025, 3:53am UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/4 "2025-06-03T03:53:38Z")

</div>

For “Turkiye”  
`<span style="color: rgb(0, 29, 53); background-color: rgb(255, 255, 255);">Turkiye</span>`

---

<div class="post-metadata">

**Author:** ![twhanson1](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@twhanson1](https://forums.ankiweb.net/u/twhanson1)\
**Post date:** [June 3, 2025, 4:07am UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/5 "2025-06-03T04:07:30Z")

</div>

The HTML from clicking “\<\>” over the Country field does not paste here for some reason. BTW I also tried the following search with the same results: `Country:re:\D+-\D+`

---

<div class="post-metadata">

**Author:** ![sorata](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/sorata/32/34115_2.png) [@sorata](https://forums.ankiweb.net/u/sorata)\
**Post date:** [June 3, 2025, 5:37am UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/6 "2025-06-03T05:37:44Z")

</div>

The forums support HTML formatting so you have to paste it in a code block like this:

````auto
```
Text goes here
```

````

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [June 3, 2025, 6:55am UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/7 "2025-06-03T06:55:02Z")

</div>

[I edited your post for you to code-block your HTML.]

> [@twhanson1](#):
>
> `background-color`

As you can see, there’s your hyphen.

> [@twhanson1](#):
>
> BTW I also tried the following search with the same results: Country:re:\D±\D+

What were you trying to search with that? I would think that `±` is that literal character. Do you have that in your “Country” field?

---

<div class="post-metadata">

**Author:** ![twhanson1](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@twhanson1](https://forums.ankiweb.net/u/twhanson1)\
**Post date:** [June 3, 2025, 11:55am UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/8 "2025-06-03T11:55:53Z")

</div>

My Anki browser search," \D+" followed by" -\D+", gets revised in this forum as “+” superimposed over the “-” sign.

My original intent was to find a search for hyphens in the visible content of my field named Country.

---

<div class="post-metadata">

**Author:** ![Danika\_Dakika](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/danika_dakika/32/17815_2.png) [@Danika\_Dakika](https://forums.ankiweb.net/u/Danika_Dakika)\
**Post date:** [June 3, 2025, 2:40pm UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/9 "2025-06-03T14:40:25Z")

</div>

Ah! That makes more sense. [I edited your post to code-block that as well.]

Yes, that would match on the same CSS hyphens.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [June 4, 2025, 10:36am UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/10 "2025-06-04T10:36:52Z")

</div>

One way you could accomplish this is to export to a text file without HTML included, and search that.

---

<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 4, 2025, 10:37am UTC](https://forums.ankiweb.net/t/i-get-false-positives-in-the-browser-when-searching-with-regex/62094/11 "2025-07-04T10:37:45Z")

</div>

Closed on July 4, 2025, 10:37am UTC

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