Using Regular Expressions in a Where Clause

Regular Expressions, or 'Regex' for short, are sets of symbols and syntactic elements (called Metacharacters) used to match patterns of text.

Regular Expressions can be a very powerful tool to use when constructing Where Clauses as they enable collected data to be filtered in a much more precise manner than using the simple 'MATCH' operator.

For example, a Regular Expression can contain the following:

Pattern Match - range

[0-9]                Brackets indicate an inclusive range of characters to match against.   In this example, a character must be 0,1,2,3,4,5,6,7,8, or 9 to equal a match.

Alternative ranges for pattern match

[0-9] | [A-F]     A pipe (|) indicates alternatives for a character to match against.  In this example, a character must be either 0,1,2,3,4,5,6,7,8, 9 or A, B, C, D, E, F to match.

For details see the following sections:
Provide feedback on this article