Regular expressions in search regarding tags

Given there are tags from “1.01” to “1.50”, is there a ways to filter a deck to a subselection, let’s say 1.22-1.35?

1\.(2[2-9]|3[0-5])

Regex are not made for this though. That is to say, it should work just fine, but it’s usually not trivial to alter the expression to match a different range, unless you already know a bit about regex.

Thanks for the help. When I type it into the browse field, an error message occurs.

Oh, Anki doesn’t support searching tags by regex. Sorry, I was focused on the regex itself and didn’t spare a thought for the application.
In that case, the easiest solution might be to select the tags from the sidebar:

  1. Switch to the selection tool at the top right of the sidebar (Alt+2).
  2. Click on the first interesting tag (probably “1.22”).
  3. Shift-click on the last one (“1.35”).
    • This assumes the tags you are interested in are exactly the ones in between. If not, you can now use Ctrl-click to select or deselect any.
  4. Rightclick the selection and choose Search > Any Selected.
2 Likes

Thanks, that’s valuable input regarding the desktop UI.
My intention is to adjust the scope of learning in a customized deck on the phone (android) and ‘on the fly’. Such “creating search expressions by multiselection” doesn’t work on the phone I guess.

No, for AnkiMobile or Ankidroid this won’t work. If you roughly know what ranges you are going to study, you could create the filtered decks in advance, of course. By the way, there are dedicated forum categories for these platforms.

Here is another fun idea: Use an app or online Python interpreter to build the string:

print(" or ".join(map(lambda i: f"tag:1.{i:02}", range(22, 35 + 1))))
1 Like