-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregular expression ms sql.sql
More file actions
20 lines (19 loc) · 1.16 KB
/
regular expression ms sql.sql
File metadata and controls
20 lines (19 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--https://www.sqlshack.com/t-sql-regex-commands-in-sql-server/
-- Regular Expression - Description
--. Match any one character
--* Match any character
--+ Match at least one instance of the expression before
--^ Start at beginning of line
--$ Search at end of line
--< Match only if word starts at this point
--> Match only if word stops at this point
--\n Match a line break
--[] Match any character within the brackets
--[^...] Matches any character not listed after the ^
--[ABQ]% The string must begin with either the letters A, B, or Q and can be of any length
--[AB][CD]% The string must have a length of two or more and which must begin with A or B and have C or D as the second character
--[A-Z]% The string can be of any length and must begin with any letter from A to Z
--[A-Z0-9]% The string can be of any length and must start with any letter from A to Z or numeral from 0 to 9
--[^A-C]% The string can be of any length but cannot begin with the letters A to C
--%[A-Z] The string can be of any length and must end with any of the letters from A to Z
--%[%$#@]% The string can be of any length and must contain at least one of the special characters enclosed in the bracket