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

Just wanted to share my solution for this.
My language learning notes are classified by tags from level 1.01 to 1.20 and 2.01 to 2.20. This classification is from a university textbook, and new material which is usually following the language reference scheme A1 to C1 I am just allocating manually to those levels in bunches. It’s a one-time upfront task for new material imported which proved to be worth the little extra effort.

In order to ‘activate’ new matieral step by step climbing up the level-tags, I am using a filtered deck with the following search condition:
(is:new OR is:due) (tag:1.* OR tag:2.01 OR tag:2.02)
Once I have finished 2.02, I will just add "OR tag:2.03) and Anki will start adding level 2.03 cards.

Result: It shows all new and due cards up to the intended level (here in filtered deck “Learn by Level”). As you can see, there are thousands of cards beyond that level which are due already (e.g. 3099 in deck “5.IntgrChiVocab”). The presented approach allows me to automatically learn only up the inteded level although I have ‘learned ahead’ of that already before and thus having loads of due cards beyond that level.