Regex keywords smart group

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
lyndondrake
Posts: 51
Joined: Sat Jul 04, 2015 3:36 am

Regex keywords smart group

Post by lyndondrake »

Hi,

If I setup a Smart Group with this query:

Code: Select all

keywords REGEX 'Biblical ethics’
it returns results, but it also includes keywords that have 'Biblical ethics' as a substring of another keyword. But if I add ^ and $ characters it doesn't match anything:

Code: Select all

keywords REGEX '^Biblical ethics$’
How can I match a whole keyword?
lyndondrake
Posts: 51
Joined: Sat Jul 04, 2015 3:36 am

Re: Regex keywords smart group

Post by lyndondrake »

Just figured it out - answer in case anyone else has the same question:

Code: Select all

keywords REGEX '(^|\n)Biblical ethics(\n|$)
In the Bookends documentation it says that ^ matches the beginning of a line, but actually I think it matches the beginning of the field (similar for $).
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Regex keywords smart group

Post by Jon »

Regex searches have to be told if the field is multiline or it will not find matches after the first return. To do case-insensitive, multiline searches add

(?im) to the search, like this

keywords REGEX '(?im)^Biblical ethics$’


Jon
Sonny Software
Post Reply