Page 1 of 1

Regex keywords smart group

Posted: Sat Apr 18, 2020 2:48 am
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?

Re: Regex keywords smart group

Posted: Sat Apr 18, 2020 3:55 am
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 $).

Re: Regex keywords smart group

Posted: Sat Apr 18, 2020 7:25 am
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