Now that Obsidian supports regex searches with version 0.8.0, we can search for notes that don’t have links to other notes!
For this to work you’ll need to come up with a regex pattern that matches how your filenames are structured. A good help with that is https://regex101.com/.
Let’s go through an example. My filenames look like this:
[[2020-07-31 112421]]
To search for notes without those kind of links, I use this regex pattern in Obsidian’s search field:
-/\[\[[\\d\- ]+\]\]/
This is what the pattern means:
Character | Meaning |
---|---|
- |
Negation; I want Obsidian to search for notes that do not contain this pattern. |
/ |
Start of regex pattern (required). |
\[ |
The first [ of the note links ([[...]] ) properly escaped with \ . |
\[ |
The second [ from the start of the note links. |
[ |
The start of a regex character class. |
\\d |
A regex token that matches any digit character (0-9) properly escaped with \ for Obsidian’s search. |
\- |
Looking for a literal ‘-’, which appear in my note’s filename format. |
|
A literal space, which also appear in my note’s filename format. |
] |
End of a regex character class. |
+ |
Regex quantifier; repeat the preceding character class between one and an unlimited number of times. |
\] |
The first ] of the end of the note link, escaped with \ . |
\] |
The second ] that marks the end of the note link. |
/ |
End of regex pattern (required). |
In regular English, the pattern says: "Look for any digits, -
, and spaces between [[
and ]]
". But with the -
in front of the pattern, Obsidian look for notes that lack that pattern.
A nice thing about Obsidian’s new search is that we can also combine search terms. For instance, this looks for notes that have the #need-theory
tag but don’t have a link to another note:
#need-theory -/\[\[[\\d\- ]+\]\]/
Let me know what you think or any ideas for improvement you might have.
Good luck searching notes that could use some improvement.