Regular Expressions for Find and Replace
Last modified: October 23, 2019
The Find and Replace window contains a list of symbols and signs which you can use to quickly find and replace required patterns of text. They are called regular expressions.
To select a regular expression, do the following:
-
In the Find and Replace window, select the Use check box and choose Regular Expressions from the drop-down list. The arrow button next to the Find what field becomes active.
-
Click the arrow button and select a regular expression from the drop-down list. It is inserted into the Find what field.
The drop-down list contains the following regular expressions:
Syntax | Expression | Description |
---|---|---|
. | Any single character | Matches any single character except a line break. |
* | Zero or more | Matches zero or more occurrences of the preceding expression, finding all possible matches. |
+ | One or more | Matches at least one occurrence of the preceding expression. |
^ | Beginning of line | Anchors the match string to the beginning of a line. |
$ | End of line | Anchors the match string to the end of a line. |
< | Beginning of word | Matches only when a word begins at this point in the text. |
> | End of word | Matches only when a word ends at this point in the text. |
\n | Line break | Matches a platform-independent line break. In a Replace expression, inserts a line break. |
[] | Any one character in the set | 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]. |
[^] | Any one character not in the set | Matches any character not in the set of characters following the ^. |
I | Or | Matches either the expression before or the one after the OR symbol (I). Mostly used within a group. For example, (databaseImanagement) system matches database system and management system. |
\ | Escape Special Character | Matches the character that follows the backslash () as a literal. This allows you to find the characters used in regular expression notation, such as { and ^. For example, \^ Searches for the ^ character. |
{} | Tagged Expression | Matches text tagged with the enclosed expression. |
:i | SQL identifier | Matches the expression ([a-zA-Z_$][a-zA-Z0-9_$]*). |
:q | Quoted string | Matches the expression ((‘[^’]‘)I(‘[^’]’)). |
:b | Space or Tab | Matches either space or tab characters. |
:z | Integer | Matches the expression ([0-9]+). |
Was this page helpful?