Search query fails with double-digit number prefix and multiple exclusions

Bug Report: Search query fails with double-digit number prefix and multiple exclusions

Steps to reproduce:

  1. Create several notes named with numbers, e.g., 3[Name].md and 12[Name].md.

  2. In another note, link to these files: [[3[Name]]] and [[12[Name]]].

  3. Add a tag next to some of these links: #s_stu/spot.

  4. Use the following query block to search:

    • For single-digit: query "[[3[Name]]]" -file:3[Name] -#s_stu/spotWorks correctly.

    • For double-digit: query "[[12[Name]]]" -file:12[Name] -#s_stu/spotReturns “No results found” (Fails).

Expected result:
Both queries should return results that exclude the file itself and the specific tag.

Actual result:
The query fails specifically when the search term starts with a double-digit number (10 or above) AND multiple exclusions (-file and -#tag) are used simultaneously. If the tag exclusion -# is removed, the query works again even for double-digits.

Environment:

  • Obsidian version: v1.12.7

  • Installer version: v1.7.7

  • OS: [ Windows 10]

hello. You didn’t read and follow the BR report template and the troubleshooting guide.

Two quick things that I see in your example is that

  • to search for tags you should use the tag: operator
  • it isn’t clear to me if you actually used [ ] in the filename. Those characters creates problems in links and you are warned not to used them.

Please read this doc page carefully.

If you still think there is a bug, open a new bug report, follow the template, and attach, link, or DM a zip to a small vault demonstrating the problem.