drbap/dashboard-navigator-for-obsidian

Questions about regex

merlinuwe opened this issue · 7 comments

I tried this, and it works as expected:

It shows me all notes with the tag #daily AND the tag #note AND NOT the tag #täglich.

(?=.#daily)(?=.#note)(?!.*#täglich)

(It would be useful, if you enhance the documentation with some examples like this.)


How can I exclude a folder with regex?

In my vault, I have a folder /BBZ/Artfiles which I want to exclude (but not in the plugin settings).


Is it possible to make it easier for the user to use regex code?

Is it possible to combine regex with a normal query?

Is there a documentation for the search engine you use?


Idea: What do you thing about something like this?

If the focus is in search/exclude the clicked tag/path/... gets to the chosen field.

If someone pressed <STRG> and clicks, the chosen search/exclude critera is added to the search-field which has the focus. (It does not overwrite the already text.)

image

Yes, the positive lookahead assertions (?=pattern) work as expected. The negative lookahead assertion (?!pattern) works for tags because they are in the same column. But this topic is for intermediate/advanced users, those with programming knowledge.

About plugin search and search documentation, I usually only have time during weekends to work on my side projects, so I didn't have time to write a complete search documentation, I only had time to work on the project itself (released the plugin and the updates). If the user has some knowledge of regular expressions (in JavaScript) it will be easier to use some advanced functionalities it can offer. But I will try to make it easier to use advanced search features with regular expressions or maybe create a SQL-similar way to interact with the plugin (SELECT or other basic query keywords).

About the regex lookaheads or lookbehinds, the performance can be different. I am happy with the current speed of the plugin search. It uses standard RegExp object to search (name, path, date, tags, etc). If I make this search too complex it can become too slow to use. My main goals with this plugin are to make it easy to use for both programmers and non-programmers, as quick as possible (dashboard information and search), and to be a robust plugin.

I will see what I can do about this regex topic. About the suggestion to trigger exclude folder with another key press combo <STRG> + click (<CTRL> in German keyboard), I have to think more about that. I like this idea, but in my humble opinion it is better and more user-friendly to achieve this functionality using text entered on the input search field. But this idea of using a key + click on the input field to have different functionality is interesting. You can Ctrl + left-click on the file links (open the file in new tab).

Thanks for the suggestions. Stay tuned for the future updates.

All the best

Hi my friend.

Just finished the advanced search of the plugin. It is fluid, same line commands (adding or excluding elements). I really did the best I can to make it as user-friendly as possible. We won't need any regex.

After this search feature improvement, I will try to finish the functionality to embed dashboard navigator queries in notes. But the search functionality was essential to get it right, fast and easy to use.

Stay tuned. I just have to write the readme and how to use it. It will be a major update, had to refactor some parts of the code. Now you will be able to hide the columns as well. Just need some sleep, I will post later today/tomorrow (upload the new version).

All the best

Please check plugin version 3.0.0. Let me know if it is easier to use. I tested it using a 14000+ files and it is still fast even with multiple filters.

Note

You can find search documentation on the readme.

I hope you enjoy and find it useful.

All the best

So answering your first question:

It shows me all notes with the tag #daily AND the tag #note AND NOT the tag #täglich.

Using version 3.0.0. The search is:
@notes #daily #note !#täglich

More information -> readme

All the best

To exclude the folder also on the first post:

Your search + !/BBZ/Artfiles

Example:

@notes !/BBZ/Artfiles (lists all notes excluding the desired directory

Yes, your solutions greatly improve the user experience! (More feedback in #10)

Thanks for your feedback! I'll be closing this issue now and we can continue the discussion in the newer issue you opened, #10.

All the best