REGEX smart group help

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
tarot sport
Posts: 32
Joined: Sun Jan 24, 2021 11:44 am

REGEX smart group help

Post by tarot sport »

The idea seems simple but I cannot find a clear solution.
I would simply like to create a smart group that searches me for types of books and edited books that have attachments.
The first part is simple through standard rules, the second I guess through SQL but I can't seem to "put it all together." Thank you.
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: REGEX smart group help

Post by Jon »

Bookends has some built-in SQL groups you can choose from when creating a new group, and some of these show you how deal with attachments.

This search would find all Books that have attachments:

"type"=2 AND attachments <> '' -- that's two straight apostrophes, not a double quote mark at the end.

This would find all Books and Edited Books that have attachments:

("type"=2 OR "type"=6) AND attachments <> ''

Paste these into the content field of a new SQL search.

Jon
Sonny Software
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: REGEX smart group help

Post by Jon »

FYI, you may find this information in the user guide helpful:

Search for references that do or do not have attachments


To find references with attachments:

attachments <> ''

To find references without attachments:

attachments IS NULL

To find a reference with a specific attachment:

attachments REGEX '(?mi)my attachment name'

To find a reference with more than one attachment:

attachments REGEX '\n'


Jon
Sonny Software
tarot sport
Posts: 32
Joined: Sun Jan 24, 2021 11:44 am

Re: REGEX smart group help

Post by tarot sport »

Thanks a lot. Also for the addition about the other language possibilities, which help me get into it.
Post Reply