0% found this document useful (0 votes)
46 views

7-SQL (Regular Expressions)

The document explains different regular expression patterns that can be used in SQL queries to match strings. It provides examples of patterns that can match the beginning, middle, or end of a string, a single character, range of characters, or multiple options separated by pipes.

Uploaded by

gimata kochomata
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

7-SQL (Regular Expressions)

The document explains different regular expression patterns that can be used in SQL queries to match strings. It provides examples of patterns that can match the beginning, middle, or end of a string, a single character, range of characters, or multiple options separated by pipes.

Uploaded by

gimata kochomata
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

7- SQL

(Regular
Expressions)
Sign Pattern Description
^ '^ra' ^ sign represents
beginning of string.
Beginning of string
should contain “ra”.
$ 'an$' $ sign represents end of
string.
End of string should
contain “an”.
[…] '[rms]' String should contain any
character listed between
square brackets.
^[…] '^[rms]' String should begin with
any character listed
between the square
brackets.
[…]$ '[rms]$' String should end with
any character listed
between the square
brackets.
[a-z] '[a-h]e' String should contain any
character between “a”
and “h”, with the
succeeding character
being “e”.
^[a-z] '^[a-h]e' String should start with
any character between
“a” and “h”, with the
succeeding character
being “e”.
[a-z]$ '[a-h]e$' String should end with
any character between
“a” and “h”, with the
succeeding character
being “e”.
pattern 'tom' String should contain
“tom”.
pattern1|pattern2|pattern3 'tom|dick|harry' String should match any
of the patterns.
String should contain
either “tom” or “dick” or
“harry” or any of the two
or all three.
Example1: 'tom|[rms]|[a-h]e' String should match any
pattern1|pattern2|pattern3 of the patterns.
Example2: '^ra|^[rms]|^[a-h]e' String should match any
pattern1|pattern2|pattern3 of the patterns.
Example3: 'an$|[rms]$|[a-h]e$' String should match any
pattern1|pattern2|pattern3 of the patterns.

SQL Queries:

You might also like