Search syntax

Overview

theWord supports two different types of searches: Boolean search and Regular expression searches. Read below the syntax for each one. The full documentation of the Regular Expression Syntax is also included.

The default search type is Boolean search, and is the easier to use as is closer to the natural way one thinks. Yet the regular expression searches can provide some advanced features that would be unavailable otherwise.

TIP: You need to be aware that different Bible modules may use a different character for the apostrophe. This means that searching for the "Lord's" may not find what you expect in some Bibles.

Boolean searches

Boolean searches are performed by combining one or more words with operators and parenthesis.

Search operators are one of the important keys to performing advanced searches.  By inserting these operators, you can vastly improve your search capabilities.  Operators can be combined with one another and their respective search terms in many ways.  See below for explanations for all the operators:

Search Operators

Search Operators

In Boolean searches, entering a simple word will find all verses containing that word. You may use the * and ? meta-characters also. Words that start with G or H and are followed by a number, are considered Strong indices.

Examples: (WWO stands for Whole Words Only option):

Example 1: under (WWO on) will match those verses in which the word under appears.

Example 2: under (WWO off) will match those verses in which the word under, understand, understanding appears.

Example 3: use (WWO off) will match those verses in which the word use, cause, because, caused, Methuselah, household, etc appears

Example 4: use* (WWO on) will match those verses in which the word use, used, useth, usest, etc appears. Notice the * at the end, with the combination of the WWO on option that causes matches of words that only start with use

Example 5: ?use will match the word muse

Example 6: ??use will match the words cause, house, rouse, abuse, cruse, mouse, etc

Example 7: G123 will match any verse where the Strong number G123 appears.

AND - matches the words both to the right and left of the operator.  The ampersand (&) can also be used instead of this operator.

Example: Jesus AND Christ will match those verses in which both Jesus and Christ occur.

OR - matches at least one of the words to the right and left of the operator.  The pipe (|) can also be used instead of this operator.

Example: Jesus OR Christ will match those verses in which Jesus or Christ occurs.

NOT - negates the word following it.  The tilde (~) can also be used instead of this operator.

Example: NOT devil will match those verses which do not contain devil.

NEARv - matches the search terms to the left and right of the operator that occur within a specific number of adjacent verses.  The default number of adjacent verses is 3.  This can be changed in the Options tab.  You can also change the number of adjacent verses for a single search by adding the number of adjacent verses after the v.  See example 2 below.  The number sign (#) can also be used instead of this operator (e.g. #8).

Example 1: Jesus NEARv Christ will match occurrences of Jesus and Christ within 3 verses (default) of one another.

Example 2: Jesus NEARv8 Christ will match occurrences of Jesus and Christ within 8 verses of on another.

NEARw - matches the search terms to the left and right of the operator that occur within a specific number of consecutive words.  The default number of adjacent words is 30.  This can be changed in the Options tab.  You can also change the number of adjacent words for a single search by adding the number of adjacent verses after the v.  See example 2 below.  The at sign (@) can also be used instead of this operator (e.g. @8).

Example 1: Jesus NEARw Christ will match occurrences of Jesus and Christ within 30 consecutive words (default).

Example 2: Jesus NEARw8 Christ will match occurrences of Jesus and Christ within 8 consecutive words.

XOR - matches those verses that contain exactly one of the search terms (and not the other) to the left or right of the operator.  The caret (^) can also be used instead of this operator.

Example: Jesus XOR Christ will match those verse that contain Jesus but not Christ or Christ but not Jesus.

TR - used to perform searches on Strong's Numbers and their translations.  To the left of the operator should be a Strong's Number (H2345, G354) or any other valid expression, and to the right should be an expression to search to see if the given Strong's Number is translated as such.  "TR" means "translated" and this is how this operator functions.  It can also be combined with other operators to perform different functions.  See examples.  The greater-than sign (>) can also be used instead of this operator.
 
To better understand how this operator works consider the following case: In the KJV, in Gen. 1:6 we find the phrase Let there be a firmament which is mapped to Strong number H7549. Suppose that we have the expression expr1 TR epxr2 to evaluate. The expr1 will be evaluated again the H7549 (as simple text), and then expr2 will be evaluated against the Let there be a firmament text. In order for the whole expression to be true, both expr1 and expr2 must be true. So, H7549 TR firmament will match, H7549 TR (let AND be) will match, H7549 TR firm* will match. Remember that the TR operator is evaluated in reality for each combination of Strong number <-> Word/Phrase for each verse (this is why such searches can be slower).
 
Moreover, the right operand/expression of the TR operator can be a morphology expression (m/). In that case, the m/ operator is evaluated against the associated parsing and lemma information of the word associated with the Strong number (this is available in modules where both Strong numbers and Morphology parsing are available); (See below how the m/ operator is used):

Example 1: G2962 TR master will match those verses in which the Greek word κύριος is translated as master (example from KJV module).

Example 2: G2962 TR NOT lord will match those verses in which the Greek word κύριος is not translated as lord (example from KJV module).

Example 3: NOT G2962 TR lord* will match those verses where the word lord exists in a verse but G2962 is not used for its translation (example from KJV module)

Example 4: G1096 TR m/V*3S will match those verse where the G1096 Strong number (the word γινομαι) appears in the 3rd person Singular (any tense) (example from TR module)

Example 5: G1096 TR m/V-???-[23]P will match those verse where the G1096 Strong number (the word γινομαι) appears in the 2nd or 3rd person Plural (any tense) (example from TR module)

m/ - used to perform searches on morphology data (grammar) and lemmas (roots) of original language texts. Morphology data are coded with English letters (e.g. V-AAI-4SS, @ncmsa) where each one letter represents a grammatical part of the structure of the word (e.g. v is usually used for verb, n for noun etc). Not all modules that contain such information use the same notation (The RMAC module contains the analysis of these tags as they are found in the original Greek texts such as TR, WHNU, Byz, Tischendorf). The general form of the search pattern for this operator is "m/lemma@tag" (@ can be replaced with % for Aramaic words: when omitted, @ is assumed). The lemma may also be omitted (the lemma information is not present in all modules: if absent, lemma search tags are also ignored). The * and ? operators can be used for any number of chars and single char. Also, square brackets can be used for a character class (e.g. [mf] means either m or f for a specific character position). Morphological searches are basically string matching searches on the lemma and morphology tag. Searches on the morphology tags are case sensitive if this is defined in the module (irrespective of the Ignore case setting). The m/ tag may also be used as the right operand of the TR operator in order to combine Strong's numbers and morphology characteristics (see above).

Examples from the Greek NT (TR - Textus Receptus, WHNU, etc)

Example 1: m/N-NSF finds all Nouns in Nominative Singular Feminine form (run the example in the TR or WHNU module)

Example 2: m/N-* finds all Nouns

Example 3: m/V-???-3? finds all Verbs in 3rd person

Example 4: m/V-A??-?S finds all Verbs in Aorist in Singular (any person)

Example 5: m/γεννάω@* finds all verbs whose lemma is γεννάω - notice that the module MUST contain the lemmas

Example 6: m/γεννάω@?-???-3P finds all verbs whose lemma is γεννάω and appear in the 3rd plural

Example 7: m/γ*@N* finds all words whose lemma starts from γ and are nouns

Example 8: G1080 TR m/V-???-3P finds all words(verbs) with G1080 Strong's number that are verbs in the 3rd plural

Example 9: G80 TR m/N-D?? finds all words(nouns) with G80 Strong's number that are in Dative case

 

Examples from the Hebrew OT (Westminster Hebrew Morphology module)

Example 1: m/@v* finds all verbs of Hebrew origin (notice the @)

Example 2: m/v??3*+Rq finds all 3rd person verbs, Qere readings only, Hebrew or Aramaic (notice no @ or %, so both included)

Example 3: m/%*+Nq finds all Aramaic lemmas (notice the %) with the Note q (different Ketiv/Qere relative to BHS).

Example 4: m/n*s*+* finds all singular nouns

Example 5: m/ברא@* finds all word forms whose lemma is ברא

Example 6: m/ב*@[na]* finds any Hebrew noun or adjective starting with the letter ב

 

( ) - used to group sub-expressions and assign priorities to the operators.  By default, all operators are evaluated left to right.  Using parenthesis can change that order

Example 1: (Jesus AND Christ) OR (Peter AND Paul) matches the verses that contain both Jesus and Christ or both Peter and Paul.

" " - used to search an exact phrase.

Example: "Jesus Christ is Lord" matches the exact phrase.  If you omitted the double-quotes, depending on your selected default boolean search operator (see below), it would be treated as Jesus AND Christ AND is AND Lord or Jesus OR Christ OR is OR Lord.

TIP: If you want to search for the literal text of any of the search operators, you need to prepend the operator with a backslash \. For example, if you want to find the verses that contain the word AND in it, you need to write \AND in the input box.

Regular expression searches

The term Regular Expression refers to a specific syntax that is used to express text queries. Although it can be quite complex, the basics are essentially relatively simple. The Regular Expression syntax is very powerful and allows for very specific searches if ones knows how to use. You may read the complete Regular Expression Syntax.

TIP: Ignoring diacritics will not work on regular expression searches. So if you have the Ignore case and diacritics option checked, only the case of the letters will be ignored.

Quick explanation

A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. As a trivial example, the pattern

The quick brown fox

matches a portion of a subject string that is identical to itself. The power of regular expressions comes from the ability to include alternatives and repetitions in the pattern. These are encoded in the pattern by the use of “meta-characters”, which do not stand for themselves but instead are interpreted in some special way.

There are two different sets of meta-characters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the meta-characters are as follows:

  \     general escape character with several uses

 .     match any character

 ?     matches zero or one time(s) the preceding character/expression.

 *     matches any number of times the preceding character/expression.

 +     matches one or more time(s) the preceding character/expression.

{x,y}   matches one or more of the preceding character/expression between x and y times

[ ]    Matches any single character, or range in the brackets (character class)

 |     start of alternative branch (or)

\d     matches any decimal digit

\D     matches any character that is not a decimal digit

\s     matches any white space character

\S     matches any character that is not a white space character

\w     matches any "word" character (A "word" character is any letter or digit or the underscore character, that is, any character which can be part of a "word")

\W     matches any "non-word" character

\b     matches at a word boundary

\B     matches when not at a word boundary

Part of a pattern that is in square brackets is called a "character class". In a character class the only meta-characters are:

 \     general escape character

 ^     negate the class (not)

 -     indicates character range

 [     starts a character class

 ]     terminates the character class

 

Examples

Just using the above meta-characters, it is very easy to perform complicated searches:

Jesus|Christ will match any verse that contains the word Jesus OR the word Christ (notice that the symbol | is used as an OR, e.g. match one OR the other)
\buse\b will match the word use but will not match words that contain the letters use in the middle of the word (e.g., it will not match the words because, used, house, etc). Notice that the sequence \b matches a word boundary (e.g. the beginning or end of a word).
\Buse will match the words cause, confused, house, etc but it will not match the words use, used, etc. Notice that the \B (capital B) sequence matches when NOT at a word boundary, so no word that start with use will be returned
Jesus.*Christ will match a verse that contains the words Jesus and Christ in that given order. Notice that the .* sequence means: . (dot) means any character, * (star) means this character any number of times. So the sequence .* matches every sequence of characters. So, in order for a verse to match this given phrase, the words Jesus + <any number of characters> + Christ shall be matched.
Jesus.*Christ|Christ.*Jesus will match those verses that contain both words Jesus and Christ in any order. Actually, this phrase can be read as: Jesus <followed by> Christ OR Christ <followed by> Jesus which is equivalent to Jesus AND Christ
Jesus.{1,10}Christ will match those verses that contain the words Jesus and Christ, in that order but not more than 10 characters away. Notice that the "." (dot) means any character and the phrase {1,10} means that this any character may be repeated between 1 and 10 times.
abrah?a?m will match those verses containing the word Abram or Abraham. Notice that the letter h is followed by a question mark (?), which means that it matches 0 or 1 times. The same applies for the second a (followed by a question mark).
abra(ha){0,1}m matches also Abram or Abraham. This syntax is almost identical (as to the result) to the previous one. Notice that the phrase ha (enclosed in parenthesis) is followed by a quantifier that defines that this phrase may be matched 0 or 1 times.
(god|man).*created will match those verses that contain the word god or man, followed by the word created any numbers of characters away. Notice that the parentheses are used to group the expressions god and man.
 
 
  theWord®
  ©2003-2012 Costas Stergiou
manual version: 4.0.1327