More query questions

Hi,

trying to work out how to search for lines in notes that have the ‘- [ ]’ AND the name ‘Joe Bloggs’ AND a tag of ‘#Agenda

I know from past experience you have to use :

(joe bloggs #agenda)

But can’t work out how to also include the check for the checkbox.

As a final question… how do I remove results that return the query block itself? I’m guessing I need to start with ‘-’ but each attempt gives me nothing :frowning:

thanks

Hi, Jaipal.

I believe this will do what you need:

```query
line:(/(?<!query\n.*)\- \[ \]/ /(?<!query\n.*)#agenda/ /(?<!query\n.*)joe bloggs/ )
```

This searches for lines that contain all three elements (- [ ], #agenda and Joe Bloggs). Each one is preceded by a regex negative lookbehind (?<!query\n.*) to make sure that the matching line isn’t inside a query block.

2 Likes

thank you for the suggestion - doesn’t return anything for me unfortunately. I did a test line in a daily note with the following text:

  • [ ] testing something joe bloggs #agenda

But the query returns no results

It works for me:

But I think I know what’s going on. You must have performed a regular copy/paste from my reply into your daily note. That escapes several characters with back slashes, thus breaking the query expression.

Try again, this time copying with the usual Cmd+V and pasting with Cmd+Shift+V.

1 Like

You sir are a legend … thank you :slight_smile:

1 Like

Glad it worked. Cheers!

1 Like