Full-text case-insensitive regex

Is it possible to ignore case sensitive string queries? Say I have the multiple nodes with “Climate Trace”, “Climate TRACE”, “climatetrace”. How do I write the correct query to make sure I don’t miss any nodes? Is there regex capability?

{{query “climate trace”}}

1 Like

Advanced queries support regex.
Here’s the query for you:

{:title "Climate Trace"
[:find (pull ?b [*])
:in $ ?input
[(str "(?i)" ?input) ?pattern]
[?b :block/content ?c]
[(re-pattern ?pattern) ?q]
[(re-find ?q ?c)]]
:inputs ["climate trace"]

I was using {{query "term"}} but that is case sensitive, so I was open a question here to ask for a case-agnostic solution. Discourse suggested this page, which is exactly what I was looking for.
Thank you :pray:

1 Like