Boolean Expressions |
Top Previous Next |
FileLocator Network's Boolean expression engine supports Web style search expressions using the AND, OR, NOT, NEAR, and LIKE operators. FileLocator Network can be configured to match the expression across the whole file (default) or on a line by line basis in the Expression Tab.
Line by Line example
The expression work AND document searches for lines that include the words work and document. Since FileLocator Network implicity assumes an AND the expression can alternatively be written as work document.
The expression work OR document searches for lines that include either 'work' or 'document'.
The expression work NOT document searches for lines that include 'work' but not 'document'.
Whole file example
The expression work AND document searches for files that include the words work and document. The words can occur on the same line or on different lines throughout the file.
The expression work NOT document searches for files that include work but not document anywhere in the file.
Note: the operators AND, OR, and NOT must be written in capital letters otherwise they are assumed to be search terms.
Quotes can be used to search for literal phrases, e.g.
"work document" searches for the exact phrase work document.
Brackets can be used to specify phrase grouping, e.g.
The expression work AND (document OR letter) searches for lines that include work and either document or letter.
LIKE Operator
If the spelling of the search term is unsure, or possibly misspelled in the search text, the LIKE operator can be used to specify an approximate search term. For example,
LIKE necessary
will find necessary but also slight variations such as neccessary.
NEAR Operator
To specify that two search terms should be near to each other in the search text use the NEAR operator. For example,
work NEAR document
will only match the two terms if they are within a certain number of characters of each other.
Boolean Sub Expressions
Boolean expressions are comprised of sub expressions. The sub expression type will depend on the expression type chosen
1 The wildcard setting is specified in the Boolean Expressions (the default is to allow wildcards).
Example: Boolean RegEx
By using the Boolean RegEx expression type regular expression searches can be combined using the operators AND, OR, and NOT. The regular expressions are evaluated on each line but the behaviour of the Boolean combination of those regex results, ie line by line or across whole file, is defined by the Boolean Expression settings in the Boolean Expressions.
Line by Line example
The expression [0-9]+ AND document searches for lines that include both a number and the word document.
The expression "[a-z]+@[a-z]+" NOT "\.(com|net)" searches for lines with email like text but not including .com or .net. Note the use of quotes to show the regular expression grouping (otherwise the brackets would have been treated as a boolean grouping).
Whole file example
The expression "([0-9]+\.){3}[0-9]+" AND error searches for files with an IP address and the word error somewhere in the file but not necessarily on the same line.
Quotes are used to identify parts of the expression that are regular expressions.
Note: Due to the complex nature of the Boolean RegEx expression type searches using it are usually slower than with the other expression types. Therefore use of Boolean RegEx is only recommended when its specific capabilities are required.
|