A rusty regex. Has the Browser RegEx search changed?

For some reason, after the new update, I am no longer able to search for non-ASCII whitespaces.

you can try to search for any of these spaces mentioned here: Whitespace character - Wikipedia

for example, try searching for the following (without the square brackets) [ ] (this is U+0009). I know it looks like a normal space, but just trust me (the forum isn’t displaying it correctly :laughing:)

Anki wont do anything. instead, it will just display all of the notes in your profile…

this was a feature in the older version. a very useful one, at that. however, in the new version it vanished :cry:

i have tried using the regex flag re:, but that did not work either

i have tried enclosing the regex with " and with parentheses. that did not work

Further problems

I cannot paste any of the whitespaces listed on the previously mentioned wikipedia page into the visual editor.

in order to achieve this task, i must be in the HTML editor…

using the wikipedia page i shared above, try pasting (into the visual editor) the whitespace with the code U+2003…

Solution for the search issue

to solve this, the user must enclose the offending character with square brackets.

So, to look for the whitespace I mentioned at the start (i.e. U+0009), the user must write the following:
re:[ ] or re: .

  1. not re:" "
  2. not "re: "
  3. not re:( )
  4. not (re: )

this is weird, because in the anki manual, it shows that the expression must be enclosed by quotation marks: see this part of the manual. so, i expected 1 and 2 to work…

The problem is that leading and trailing whitespace is stripped from the search string on the assumption that it’s accidental. We could limit it to ASCII whitespace stripping, but then it may inconvenience Japanese users with full width spaces. While the current behaviour is confusing in this case, I suspect it’s a fairly niche issue, and I’m not sure the downsides of changing the current behaviour would be worth it I’m afraid.

1 Like

Agreed.

I firgured out the Rust syntax, so it’s ok.

Thank you dae! you can now close this if you want!

1 Like

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