Hi
I have 3660 references in "All"
I annotate them with "exclude" as the first word in the keywords field if they are not relevant to my current project
This search:
keywords REGEX '\Aexcluded' OR NOT keywords REGEX '\Aexcluded'
returns 3545 references (so 115 are not being captured). So I clearly don't understand something about how the search works. I thought that pair of regex queries would necessarily cover all records. Either 'excluded' starts ('\A') the keyword field, or it doesn't.
Help gratefully received
Cheers
REGEX search doesn't cover all references
Re: REGEX search doesn't cover all references
Answering your own question is regarded as bad form in some fora, so apologies that's the case here:
A search to find those not covered by the search in the first post:
NOT (keywords REGEX '\Aexcluded' OR NOT keywords REGEX '\Aexcluded')
And all of them have empty keywords field. And that's clearly not covered by NOT keywords REGEX '\Aexcluded'.
I thought it would be...
python - regex search of empty string
>>> x = re.search('a', "")
>>> x
>>> x == None
True
>>> if x:
... print("found")
... else:
... print("not found")
...
not found
What would be a search that would find an empty keywords field?
keywords REGEX ''
doesn't find any records.
A search to find those not covered by the search in the first post:
NOT (keywords REGEX '\Aexcluded' OR NOT keywords REGEX '\Aexcluded')
And all of them have empty keywords field. And that's clearly not covered by NOT keywords REGEX '\Aexcluded'.
I thought it would be...
python - regex search of empty string
>>> x = re.search('a', "")
>>> x
>>> x == None
True
>>> if x:
... print("found")
... else:
... print("not found")
...
not found
What would be a search that would find an empty keywords field?
keywords REGEX ''
doesn't find any records.
Re: REGEX search doesn't cover all references
keywords is NULL
This is covered on p.349 of the User Guide (Help menu).
Jon
Sonny Software
P.S. There is also a UI option for finding empty fields in both Find and smart searches.
This is covered on p.349 of the User Guide (Help menu).
Jon
Sonny Software
P.S. There is also a UI option for finding empty fields in both Find and smart searches.
Re: REGEX search doesn't cover all references
Ahh, yep. Thanks
Apologies for not RTFM
Apologies for not RTFM