Regular Expressions

Regular Expressions are a concise and flexible notation for finding and replacing patterns of text. The following table shows the Regular Expressions that can be inserted into the Find or Replace boxes. You can type the following regular expressions. Use regular expressions to refine and expand your search.

Note   You must press the Use Regular Expressions button before using any of the following as part of your search criteria.

Expression Syntax Description
Beginning of Line ^ Starts the match at the beginning of a line. Significant only at the start of an expression.
Or | Matches the expression before or after the |. Mostly used within a group. For example, "(sponge)|(mud) bath" matches "sponge bath" and "mud bath."
End of Line $ Anchors the match to the end of a line. Significant only at the end of an expression.
Character Not in Set [^] Matches any character not in the set of characters following the ^.
Tagged Expression {} Tags the text matched by the enclosed expression, You can match another occurrence of the tagged text in a Find expression or insert the tagged text in a Replace express using \N.
Grouping () Groups a subexpression.
Nth Tagged Text \N In a Find expression, matches the text matched by the Nth tagged expression, where N is a number from 1 to 9.

In a Replace expression, inserts the text matched by the Nth tagged expression where N is a number from 1 to 9. \0 inserts the text matched by the entire Find expression.

Any Character . Matches any one character.
One or More + Matches at least one occurrence of the preceding expression.
Maximum of One or More # Matches at least one occurrence of the preceding expression, matching as many characters as possible.
Escape \ Matches the character following the backslash (\). This allows you to find characters used in the regular expression notation, such as { and ^.
Prevent Match ~X Prevents a match when X appears at this point in the expression. For example, "rea~(ity)" matches the "real" in "realty" and "really," but not the "real" in "reality."
Repeat N Times ^N Matches N occurrences of the preceding expression. For example, "[0-9]^4" matches any 4-digit sequence.
Set of Characters [] Matches any one of the characters within the []. To specify a range of characters, list the starting and ending character separated by a dash (-), as in [a-z].
Alphanumeric Character :a Matches the expression ([a-zA-Z0-9]).
Alphabetic Character :c Matches the expression ([a-zA-Z]).
Decimal Digit :d Matches the expression ([09]).
Hexadecimal Digit :h Matches the expression ([0-9a-fA-F]+).
Identifier :I Matches the expression ([a-zA-Z-$][a-zA-Z0-9_$]*-).
Relational Number :n Matches the expression (([0-9]+.[0-9]*)|([0-9]*.[0-9]+)|([0-9]+)).
Quoted String :q Matches the expression (("[~"]*")|('[~']*')).
Alphabetic String :w Matches the expression ([a-zA-Z]+).
Decimal Integer :z Matches the expression ([0-9]+).
Tab Character \t Matches a tab character, Unicode U+0009.
Unicode Character \x#### or \u#### Matches a character given by Unicode value where #### is 1 to 4 hexadecimal digits.
Zero or More * Matches zero or more occurrences of the preceding expression.
Maximal Zero or More @ Matches zero or more occurrences of the preceding expression, matching as many characters as possible.