Can i turn off searching for a part of a word in the middle or end?

For example, when I search for the word “red” or words that start with “red” like “rediscovery”, the result shows a lot of words where “red” is in the middle, like “pREDominant” or “transgendeRED” etc. This is annoying all the time . Can I somehow do so that the result is searched for coinciding with the beginning of a word, and not in the middle or at the end?

In the search input box, using Regex as the follows:

/^red.*/
1 Like

Thanks for the answer, but it didn’t work. I want to see results like “redirect”, but I don’t want others like “configuRED”.


When using Regex, the result is nothing.

Try this:

/\sred[a-z]*/

or

/(?<=\s)red[a-z]*/
1 Like

Thanks, it worked. With some glitches, but it worked. I don’t understand why not just do a database search from the beginning of a word. This is how it works in Windows, because if there are many files, then the result turns into useless garbage.

I hoped that I can “search from the beginning of a word”. Unfortunately, I’m not the expert of Regex. :joy: So the solution is just “feasible” but not “perfect”.

For the last line of the comment, I’m not quite understand. Based on my understanding, the Regex describes the pattern of the text that you want to search but not how will the search work.

The search in Obsidian takes all the note files into its range and the search result has a hierarchical structure. I’m not sure why this is “useless garbage”?

As for Regex, you are correct that it describes a pattern, so there are some minor glitches. But I know Regex worse than you)

About “useless garbage”. Let’s say I have a note about ink. If I search for “ink” in a note, it will give me results together with “links”, but this is fune, since the note is usually not large and this is permissible.

But if I have a database and I search for keywords like ink, then in obsidian the result will be useless. A huge amount of results with “lINKS” that I don’t need. Worse, the search results are based on the alphabet, and not on the occurrence of a keyword.

I have not seen anywhere such a search in a database with a lot of files, where this is the default search. This is usually an optional feature for complex queries like Sql or Regex.

Even in this forum I cannot find any topics on obsidian by keyword “dian”. But for some reason this is built into the program. Maybe I don’t understand something. It drives me crazy. ¯_(ツ)_/¯

On the forum, the search only works by the beginning of a word.

I think I understand a little bit about what you concerned about.

For keyword, in Obsidian, you can use [[xxx]] to “create” keyword “xxx”, and the occurrence of this keyword can be tracked in the backlink panel. You may find more information about this Backlinks in the Obsidian’s Help vault.

For alphabet issue you mentioned, I think it is not the whole picture. For language as Chinese, the finest granularity (or meta component) is the character, the word and the sentence is composed of one or more than one characters and there is no space between the characters. To support the search of text written by English as well as the language other than English, the Regex is one of the universal solutions.

For example, the sentence of ”今天天很蓝“ has 5 characters but 4 words "今天 天 很 蓝” ==>Today, the sky, (is) very, Blue. As a matter of fact, the tokenization of Chinese is a complicated task in NLP.

The word-wise search is meaningful, but not simple enough.

Regex is too complicated for the average user for me. You misunderstood the keyword. I meant the keyword as a search for text and titles that convey the meaning of the note, not backlinks.

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