Oh, so many wrong conclusions that I hesitated to answer! But here it goes.
1 - You request a very specific help.
2 - My first post start with an insecure step - “I’m not sure” -, not to discredit your request but to point to the difficult of the search by the “negation”: because it’s necessary to search by exclusion in the plain md text (the search works in raw text, not in the rendered one). And exclude all scenarios isn’t an easy task, mainly (I guess, because I’m a dumb in regex) because they’re other things using the “#” in similar way as tags but they’re not tags. I used the example of dataview code blocks, but I could point to others, like simple query blocks, etc.
3 - AlanG give you a great solution. It receives my “heart”.
4 - From here, I asked from some limitations, expecting, for example, for some kind of regex (an unknown territory for me) to exclude the “```” cases or anything inside inline code “`”.
5 - You answer me that for your case that isn’t an issue. At that moment I stopped my direct interaction with your case.
6 - But AlanG answer me calling that cases as “niche issues” and give me a dataview query to use, instead of the regex solution.
7 - I answered him saying that I know how to solve that using dataview (as an answer in dql to the dvjs query he gives me) and reply that I don’t consider this cases as “niche issues”.
8 - I repeat, that was a follow up of the Alan reply, not to you. Your case was solved.
9 - Then you came up saying that my «“solution” doesn’t meet that criteria and it’s off topic.»
10 - If clarifying possible issues is something “off topic” and a way to discredit the great Alan solution… well, they’re your conclusions about my interaction. As «Don’t yuck other people’s yum», don’t deduce and classify others intentions.