title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | monikerRange | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Search text with regular expressions |
Learn how to use regular expressions in the Find what field of a Find and Replace dialog box to specify a pattern to be matched. |
markingmyname |
maghan |
randolphwest |
03/20/2023 |
sql |
ssms |
conceptual |
|
|
>=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDESQL Server Azure SQL Database Synapse Analytics PDW]
The following regular expressions can replace characters or digits in the Find what field of the [!INCLUDEssManStudioFull] Find and Replace dialog box.
-
To enable the use of regular expressions in the Find what field during Quick Find, Find in Files, Quick Replace, or Replace in Files operations, select the Use option under Find Options and then choose Use Regular Expressions.
-
The Expression Builder button next to the Find what field then becomes available. Select this button to display a list of the available regular expressions. When you choose any item from the Expression Builder, it is inserted into the Find what string.
The following table describes the regular expressions available in the Expression Builder.
Expression | Description |
---|---|
. |
Match any single character (except a line break) |
.* |
Match any character zero or more times |
.+ |
Match any character one or more times |
[abc] |
Match any character in the set abc |
[^abc] |
Match any character not in the set abc |
\d |
Match any numeric character |
(?([^\r\n])\s) |
Match any whitespace character |
\b |
Match at beginning or end of word |
^ |
Match at beginning of line |
.$ |
Match any line break |
\w\r?\n |
Match a word character at end of line |
`(dog | cat)` |
`(?dog | cat)` |