Cannot find replace html (regex) in all notes

I am using Anki version 2.1.44

Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2021-07-04 15:48:34

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
    
===IDs of active AnkiWeb add-ons===
    
===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

I am trying to remove <br> tags from my fields like this:

But if I select all cards and run this find and replace:

Anki will only replace 1 card.

If I select everything again and run another find and replace, Anki will now replace 0 (no cards).

Anki will only accept to replace another card if I select its html field and hit Ctrl+Shift+X (to view the html, as my first screenshot). Now, after seeing that card html, and I select all cards again and run another find and replace, Anki will replace only 1 note again.

1 Like

After I searched and replaced with the expression <br\s*/\s*> it replaced all except one <br>.

I filtered the decks with "re:<br", and I found only one card. Then, I repeated the search and replace after seeing the html with Ctrl+Shift+X and the last card was finally replaced.

I tested this with Anki 2.1.22, 2.1.8, and 2.0.52 and the behavior was the same.

I think it’s been fixed in 2.1.45, maybe give the current beta a try.

3 Likes

Thanks! With the latest beta, I can see my html fields are mostly <br /> instead of just <br>, now it makes sense that only <br\s*/\s*> would work to remove the <br> tags.

1 Like