Regular expressions find

<< Click to Display Table of Contents >>

Navigation:  Reference Manual > Definitions >

Regular expressions find

Regular expressions are a form of syntax used to describe pieces of text to be searched for or found.

A regular expression can be chosen in the Entry select to search for particular entry names and texts.

There are many online resources including http://www.regular-expressions.info that describe how to write a regular expression for .NET programs.

See Regular expressions replace for some examples of find and replace strings.

Search string special characters

Here are some characters with special meanings when using regular expression search strings:

Use [0-9] for any digit

Use [A-Z] for any letter

Use \w for any word or letter

Use . (dot) for any single character

Follow with + (plus) to mean one or more

Follow with * (star) to mean none or more

Follow with ? for optional (none or one)

Use .* (dot star) for any characters, or none

Use .+ (dot plus) for any characters, but at least one

Use ^ (hat) at front to look at the first character

Use $ (dollar) at end to look at the last character

Use | (bar) for choices

Use \b to denote the beginning or end of a word

Use ( ) to group texts

Do not use spaces in search strings unless you are searching for a space character in the text.

To look for texts containing the special characters you need to "escape" them by putting a \ before the character.

IMPORTANT: although the search may not be case sensitive, regular expressions themselves are.  You can use \d (instead of [0-9]) but you cannot use \D instead because this means something different.

Example regular expressions for name searches

This find text....

Will select texts that...

X4

Contain the two characters X4 together

[XY]

Contain an X or a Y

^V

Begin with a V

[ABC]$

End with A, B or C

[A-Z][0-9]

Contain a letter followed by a digit

[ABT][468]

Contain an A, B or T followed by a 4, 6 or 8

Q17|Q18

Contain Q17 or Q18

^V.*[0-9]

Begin with V and contain a digit

^V.*[A-Z]$

Begin with V and end with a letter

^V[0-9]$

Start with V followed by a single digit

^VQ[0-9]A$

Start with VQ, followed by a single digit, followed by A

^VQ[0-9]A?$

Start with VQ, followed by a single digit that may be followed by A

^V[0-9]+$

Start with V followed by one or more digits (but no letters)

^VQ[0-9]+[A-Z]+$

Start with VQ followed by one or more digits followed by one or more letters

(^FQ1)|(^Q1)

Begin with FQ1 or Q1

^\w\w\w$

With  three characters

\.

Contain a . (dot)

Example regular expressions for text searches

This find text....

Will select texts that...

Market

Contain the characters "market"

\bMarket

Contain words beginning "Market"

\bMarket\b

Contain the word "Market"

\bMarket research\b

Contain the words "Market research"

\bTables?\b

Contain the words "Table" or "Tables"

\bWash(ed)?\b

Contain the words "Wash" or "Washed"

\bWash\w*\b

Contain the word "Wash" or any longer word starting with "Wash"

\.$

End with a "."