Is it possible to use wildcards in queries?

The use case would be to find pages that start with a certain text.

For example, all pages that start with “task.myName.”.
Something like {{query [[task.myName.*]] }} or can this be done with an advanced query?

Thanks for your help.


Since you said start with, one way to do this below. You can replace starts-with with includes or ends-with.

{:query [:find (pull ?b [*])
         :in $ ?s
         [?b :block/original-name ?n]
         [(clojure.string/starts-with? ?n ?s)]]
 :inputs [ "task.myName." ]

If you want to use wildcards, you need to use regex, check out Bailey Jennings’ search query here. If you need further assistance, just tell.


That was quick and helped me a lot.
Thanks :slightly_smiling_face:

@c6p Thanks again for the solution.

What I noticed is that the result is only shown in table form and there is no button to switch to block view.
Is there something about the query that causes that or is this a bug or something else?


It was asked a few days ago and here is tienson’s answer. For now page queries shown in table view.

1 Like