Search for document containing two tags

Things I have tried

I’ve tried find out how to do it. Just using two tags in te search field don’t work. I’m also not trying to find two tags in the same block, but in the same document, so block:(#tag1 #tag2) don’t work (that was the solution here

What I’m trying to do

Im trying to search for documents containing two tags (or more). I do not want to see documents that only contain one of them. Where the tag is in the document does not matter, they can be placed inline, or in the front matter.

Right yesterday I spent one hour and more with the same problem. Following regular expressions (RegEx) this worked for me:


Simply two same rows like


with a space in the middle

Thank you. I see this work sometimes. If I have nested tags it sometimes does not work (/#[^\s]*tag1/subtag1/), but I don’t know why. If I turn on “Explain search term” it divides the string on /#.

Is this the only solution? Its super inconvenient to write so much for a simple search with more than one query. :sweat_smile:

This works for me too:

/#[^\s]*\Word1/subtag1 Word2/subtag2 Word3/subtag3

Hehe, if I just write

tag:#tag1 tag:#tag2

it searched for “match all”. So it actually just finds the files that contains both of the tags. Im so sorry for using your time!

no problem, that’s been useful for me too

1 Like

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