What is the field separator character when performing regex search (i.e. re:) in the browse window?

The title explains it all but I will add a little bit of context.

This is my search string in the browser

re:^[^\t]+\t[^<]

Am trying to find a note whose First field exists, and second file does not begin with <

Apparently the field separator isn’t ,;\t because none works.

I can’t use the field names because they are not constant. How do I go about it?

The separator character is \x1f. Try this expression:

re:^[^\x1f]+\x1f[^<]
3 Likes

Is that a single character or multiple? Just checked, it not \x1f

It’s a single character, U+001F Information Separator One.

That’s interesting. Thanks a lot.

This is definitely not in the docs, is it?

1 Like

Apparently not. I had to look in the Anki source code to figure it out.

3 Likes

It doesn’t work on AnkiDroid.

This is an implementation detail. I don’t think it’s explicitly supported.

1 Like

Searching is done by the backend so it works on mobile clients as well. This trick won’t work for notetypes that have a field excluded from search, however

It didn’t work in my testing. I don’t really care, but wanted to point it out.

Edit: re:^[^\x1f]+\x1f[^<\x1f] ensures that the second field is non-empty.

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