Regular Expression (RegEx) commands can be carried out using the main tool bar or the buttons on the tool strip. This section describes what each function does and how it appears in a Regular Expression.
Inserts a \w in the RegEx.
Matches a single alphanumeric character in the search data. Use anytime an alphabetic or numeric character would be appropriate.
Inserts a \s in the RegEx.
Matches a single space in the search data. Use anytime you want to match a space.
Inserts a \d in the RegEx.
Matches a single numeric character in the search data. Use anytime searching for a number would be appropriate.
Inserts a ^ at the beginning of the RegEx.
Instructs the search to only match data if it appears at the beginning of a line, rather than anywhere in a line or the end of a line. For example, to match the word "hello" only if it appears at the beginning of a sentence, use ^hello.
Inserts a $ at the end of the RegEx.
Instructs the search to only match data if it appears at the end of a line, rather than anywhere in a line or at the beginning of a line. For example, to match the word "final" only if it appears at the end of a sentence, use final$.
Inserts a \b at the beginning of a word.
Instructs the search to only match data if it appears at the beginning of the word, not in the middle or end of a word. For example, searching \bcan would match "can" and "Canada," but not "American."
Inserts a \b at the end of a word boundary.
Instructs the search to only match data if it appears at the end of a word, not in the middle or end of a word. For example, searching can\b would match "can" and "American," but not "Canada."
Inserts a \b at the beginning and end of the word boundary.
Instructs the search to only match data if it is the entire word, not part of the word appearing at the beginning, middle, or end. For example, searching for \bto\b would only match data containing "to," not "towards" or "hereto."
Inserts ( ) around the word. Separate each word within the ( ) with a |.
Allows a search to match two or more different words in the same place. For example, use (there|here) to indicate the search should search for either "there" or "here" in the search data.
Inserts [ ] around the character.
Allows a search to match two or more different characters in the same place. For example, use happ[yi]ness to match both "happyness" and "happiness."
Inserts ? after an alternate word or character marker in the RegEx.
Allows a search to match data with or without the optional character. For example, use colo[u]?r to match both "color" and "colour."
Inserts * after an alternate word or character marker in the RegEx.
Specifies that a string of text can be repeated once or more. For example, use (the)* cat to match "the cat" and "cat" in a string of text.
Inserts + after an alternate word or character marker in the RegEx.
Specifies that a string of text can be repeated once or more. For example, use (the)+ to match "the" and "the the" in a string of text.
Inserts ( ) and { } containing a minimum or maximum number.
Instructs the search to match a string of text that repeated a specified number of times. For example, use (the){3,8} to match "the" between three and eight times in a string of text. Or use (the){,4} to match "the" up to four times, or (the){2,} to match "the" at least two times.
Allows the search to match text without being case sensitive. For example, use (?i)usa(?i) to match "usa" and "USA." Or use (?i)America to match "America" and "america."
The Regular Expression builder also contains three sample expressions to search for basic matches, including email addresses, phone numbers, and IP addresses. Inserting a sample expression will automatically insert the code for one of these options.
Return to Using RegEx