farux / obsidian-auto-note-mover

This is a plugin for Obsidian (https://obsidian.md).
MIT License
290 stars 22 forks source link

Multiple Tags Within A Single Rule #65

Open Ken9969 opened 1 year ago

Ken9969 commented 1 year ago

Auto Note Mover is a great Obsidian plugin! Still, I'd like to be able to enter several tags on a single rule. For example, say I have a directory titled 'Reference'. I'd like to send several differently tagged notes to that directory with one rule. For example, if I have notes tagged 'User-Guide' and 'Manual' and 'Obsidian-Reference', I'd like to use a single rule with the tags entry '#User-Guide, #Manual, #Obsidian-Reference' to send notes with any one of these several tags to a given directory. As it is now, I have to make three rules to accomplish this and if I wish to add another tag to go to that same directory, I have to create a new rule. I know I could change the tags to all be the same, but then that diminishes the ability to use tags to accomplish better searches.

Davidyao217 commented 1 year ago

Toggle on the "Use regular expressions to check for tags" option. Come up with a regex expression that evaluates to true if any of those tags are in the string; bard or chatgpt should be able to come up with it.

Ken9969 commented 1 year ago

Thanx... That worked great!

bhavers commented 6 months ago

I can't get this to work to match two tags (they both should match). Anyone has an example of that? thx

greenship24 commented 6 months ago

I recommend using regex101.com or similar to test your string.

This for instance will match tags for #London, #Stockholm, or #Paris- ^(#London|#Paris|#Stockholm)

Adapt to whatever you need.