Boolean queries in Writer

Is there a way to search something using boolean operator like OR, AND, etc.?

Hello,

there are no boolean functions like OR, AND, etc…for text searches. The LibreOffice way is to use regular expressions - see

Hope that helps.

If the answer helped to solve your problem, please click the check mark (:heavy_check_mark:) next to the answer.

New ICU’s Regular Expressions page.

Search key1 and key2 within each paragraph

Step a) CTRL + H3, search ^(.)*key1(.)*$
with “regular expression” flag activated

Step b) step a has selected all paragraph containing key1.

search (CTRL + H) ^(.)*key2(.)*$
activating both the “only in selection” and “regular expression” flags


Search key1 or key2 within each paragraph

Search (CTRL + H ) ^(.)*(key1|key2)(.)*$
with regular expression flag activated

Only paragraphs with key1 and key2 in the first case and key1 or key2 in the second will be selected.

With a macro, the search with the and connector can carry out the two steps in sequence (or the n steps for n keys connected with and)