Regular expressions for Find and Replace

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:

  1. 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.
  2. 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 ^.
| Or Matches either the expression before or the one after the OR symbol (|). Mostly used within a group. For example, (database|management)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 ((“[^”]”)|(‘[^’]’))
:b Space or Tab Matches either space or tab characters.
:z Integer Matches the expression ([0-9]+).

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?