Please enable JavaScript to use regex101
Regular
Expressions
101
Support Regex101
Social
Info
Regex Editor
Community Patterns
Account
Regex Quiz
Settings
Order By
Most Recent
Most upvotes
Most downvotes
Highest Score
Lowest Score
Relevance
Filter by Flavor
PCRE2 (PHP)
ECMAScript (JavaScript)
Python
Golang
Java
.NET 7.0 (C#)
Rust
PCRE (Legacy)
Sponsors
There are currently no sponsors.
Become a sponsor today!
Community Patterns
Search among community submitted regex patterns...
0/512
3
Sql Injection detection
Created
·
2016-08-12 01:11
Flavor
·
ECMAScript (JavaScript)
this regex detect any sql injections .
Submitted by
Saeed.Tabrizi@gamil.com
3
sql: insert into
Created
·
2015-07-25 11:00
Flavor
·
PCRE (Legacy)
insert into (a,b,c) values (1,2.3,"test");
Submitted by
suat erenler - sua.gen.tr
3
SQL select columns
Created
·
2013-09-07 13:09
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Phan
4
Hibernate SQL Reductor
Created
·
2015-03-19 16:11
Flavor
·
ECMAScript (JavaScript)
If you want to understand an SQL statement for Hibernate: this replaces the selected fields in an SQL statement generated by Hibernate by a shorthand, since you usually just care about the logic. E.g. it changes select foo0_.bla as bla1_3, foo0_.bar as bar1_3, foo0_.baz1_3 as baz1_3 from ... to select foo0_.**1_3 from ...
Submitted by
Hans-Peter Stoerr www.stoerr.net
2
multiple sql like expressions
Created
·
2016-08-10 12:04
Flavor
·
PCRE (Legacy)
no description available
Submitted by
robessog
2
paramaterised sql like expressions for sybase
Created
·
2016-08-10 12:00
Flavor
·
PCRE (Legacy)
no description available
Submitted by
robessog
1
parse SQL statements and get values
Created
·
2014-02-22 04:18
Flavor
·
PCRE (Legacy)
but it does not work. How do I make it work? It will be used in C#
Submitted by
anonymous
1
JSON to CASE WHEN THEN SQL block in one step
Created
·
2025-06-04 10:18
Flavor
·
PCRE2 (PHP)
Converts a JSON-like object of "key": "value" pairs into a SQL CASE statement using a single regex replace with named conditional groups. ✅ Works in PCRE2 flavor only. 🚫 Will not work in JavaScript, Python <3.12, or other engines without conditional replacements.
Submitted by
Moron
1
exe sql select
Created
·
2025-05-28 15:28
Flavor
·
Python
EXEC\s+SQL\s(?:[\r\n]\s\s)*SELECT
Submitted by
Tony
1
Firewalls Juniper
Created
·
2024-09-16 11:16
Flavor
·
PCRE2 (PHP)
09/21/11 10:47 29 Allow Partner-SQL-eComm 46990 tcp Partner-Web-eComm mysql 19999
Submitted by
vicevil
1
Match SQL Comments
Created
·
2024-08-14 09:47
Flavor
·
PCRE2 (PHP)
fluiddigitalmedia.com
Submitted by
anonymous
1
SQL Condition
Created
·
2024-07-15 01:12
Flavor
·
PCRE2 (PHP)
Not fully compliant, please don't use for security or for anything extremely important. Might be a good jumping off point though (although its a bit hellish looking)
Submitted by
anonymous
1
IsNumeric Test
Created
·
2024-04-11 15:49
Flavor
·
PCRE2 (PHP)
Tests for any value that can be converted to a T-SQL numeric type.
Submitted by
Noel Cruz
1
T-SQL find text blocks in script
Created
·
2024-04-04 09:01
Flavor
·
PCRE2 (PHP)
Finds the text blocks in a t-sql (tsql) script
Submitted by
Paw Jershauge
1
T-SQL find comments in script
Created
·
2024-04-04 08:50
Flavor
·
.NET 7.0 (C#)
Finds the comments in a t-sql (tsql) script
Submitted by
Paw Jershauge
1
T-SQL find comments in script
Created
·
2024-04-04 07:46
Updated
·
2024-04-04 08:51
Flavor
·
PCRE2 (PHP)
Converts the outcome from an SQL Agent Log (one liner) to multi lines, for easy read
Submitted by
Paw Jershauge
1
Match T-SQL view definition
Created
·
2023-11-01 10:41
Flavor
·
PCRE2 (PHP)
This regex matches the Transact SQL statement for selecting the database and creating a view.
Submitted by
anonymous
1
Get all table from sql query string | 从SQL查询语句中获取所有表名
Created
·
2023-10-26 03:08
Flavor
·
PCRE2 (PHP)
Get all table from sql query string | 从SQL查询语句中获取所有表名。 WelineFramework PHP8 。
Submitted by
Aiweline/秋枫雁飞
1
Imperva audit log regex
Created
·
2022-05-05 04:05
Flavor
·
PCRE2 (PHP)
Contains regex to parse the CockroachDB SQL audit log file
Submitted by
Lesley Miller
1
PHP PDO debugDumpParams parse as sql.
Created
·
2022-04-15 14:59
Flavor
·
PCRE2 (PHP)
解析php pdo 的 debugDumpParams 输出的数据。
Submitted by
anonymous
1
SQL comments Big Query
Created
·
2021-09-23 15:19
Flavor
·
Golang
SQL comments on Big Query
Submitted by
anonymous
1
No permitir loop con sql
Created
·
2020-08-21 15:50
Flavor
·
PCRE (Legacy)
((LOOP\s+AT\s+\w\s+INTO\s+\w(.?)\s+)((INSERT|DELETE|UPDATE|MODIFY)\s+(\w\.?\?\s+)(FROM\s+\w\.\s*)?(ENDLOOP\.)))
Submitted by
anonymous
1
Get SQL FROM
Created
·
2018-06-06 10:12
Flavor
·
PCRE (Legacy)
SELECT * FROM wp_users WHERE user_login = 'username'
Submitted by
Lars Jansen
1
Extract Sql Columns from the given query
Created
·
2016-10-17 06:54
Flavor
·
ECMAScript (JavaScript)
Tries to find the column names from the given SQL query.
Submitted by
anonymous
1
SQL Limit Clause
Created
·
2016-09-21 10:23
Flavor
·
PCRE (Legacy)
checks for valid limit clause of an sql statement
Submitted by
Magesh Kumaar
1
matching sql input
Created
·
2016-09-08 16:21
Flavor
·
ECMAScript (JavaScript)
no description available
Submitted by
mee
1
SQL placeholder match
Created
·
2016-09-05 09:21
Flavor
·
PCRE (Legacy)
no description available
Submitted by
Andy Chentsov
1
Capture Comments on SQL followed by SELECT
Created
·
2016-09-01 14:07
Flavor
·
Python
Shag Maister is the best
Submitted by
anonymous
1
right operand of parametirezed sql like expressions for sybase
Created
·
2016-08-10 12:01
Flavor
·
PCRE (Legacy)
no description available
Submitted by
robessog
1
Sql where in list
Created
·
2016-08-10 06:46
Flavor
·
PCRE (Legacy)
no description available
Submitted by
anonymous
1
Extract name of tables from a SQL
Created
·
2016-05-19 14:46
Flavor
·
PCRE (Legacy)
Assumes the database name starts with "IDP_PRD_"
Submitted by
Vance
1
Get table name from query
Created
·
2016-04-18 16:34
Flavor
·
PCRE (Legacy)
this extracts the table name in the from or join clause from SQL query
Submitted by
vwei02
1
match sql identifiers but not functions
Created
·
2016-04-03 21:38
Flavor
·
PCRE (Legacy)
no description available
Submitted by
ikkez
1
ConnectionStringServerDatabase
Created
·
2016-03-07 00:33
Flavor
·
Python
Extract the server and database name from SQL Server connection string
Submitted by
Davos
1
Split SQL statements on 'GO'
Created
·
2016-02-11 07:24
Flavor
·
PCRE (Legacy)
Splits a SQL script into sections seperated by GO statement
Submitted by
Michael Skovslund
1
Alter SQL Create Table
Created
·
2016-01-15 17:22
Flavor
·
PCRE (Legacy)
no description available
Submitted by
anonymous
1
Sql Server Version Number
Created
·
2015-12-31 01:04
Flavor
·
PCRE (Legacy)
no description available
Submitted by
anonymous
1
SQL COLUMNS TO EMERGENCE COLUMNS SPEC v2
Created
·
2015-12-25 00:37
Flavor
·
PCRE (Legacy)
no description available
Submitted by
anonymous
1
SQL columns to Emergence columns spec
Created
·
2015-12-25 00:31
Flavor
·
PCRE (Legacy)
no description available
Submitted by
anonymous
1
SQL LIMIT REMOVE
Created
·
2015-12-16 06:21
Flavor
·
PCRE (Legacy)
SQL LIMIT REMOVE
Submitted by
Lucas Pinheiro
1
sql select request
Created
·
2015-12-07 03:17
Flavor
·
PCRE (Legacy)
matching any SQL query starting by "SELECT foo,bar FROM fool,baz {...}" this one is the good one. first one have a matching alowing * in the FROM statement.
Submitted by
klmmlk
1
SQLALCHEMY_DATABASE_URI parser
Created
·
2015-11-13 20:04
Flavor
·
Python
Parse SQLALCHEMY_DATABASE_URI
Submitted by
jdnier
1
Simple RegEx for SQL Field transformation
Created
·
2015-10-14 15:01
Flavor
·
Python
no description available
Submitted by
sX
1
Find your Db from a sql query
Created
·
2015-08-13 14:46
Flavor
·
PCRE (Legacy)
A regex to find the db wich you're quering against to.
Submitted by
kkrico
1
sql: insert into
Created
·
2015-07-25 11:15
Flavor
·
PCRE (Legacy)
insert into table ( a, b, c ) values ( " insert into values (1,2,3)",1,2.3,"a,b" ); insert into table (ee,bb,cc) values (aa,234,"asj",2.3);
Submitted by
suat erenler - sua.gen.tr
1
sql perf log
Created
·
2015-07-14 09:49
Flavor
·
PCRE (Legacy)
13 fields, 12 comma's from right (all left hand ones need to be ignored as they're part of the sql statements)
Submitted by
Sandra
1
Remove GO and split for batch SQL text
Created
·
2015-04-27 13:44
Flavor
·
ECMAScript (JavaScript)
Useful for when you need to convert a T-SQL MSSMS Server batch into individual SQL requests by removing the GO between them. e.g. Dim SQLBatches As String() = Regex.Split(text, "(?:\s|\r|\n)+GO\s*(?:\r|\n)", RegexOptions.IgnoreCase)
Submitted by
SarahC
1
t-sql batch script parser
Created
·
2014-12-24 06:46
Flavor
·
Python
Splits t-sql script into separated commands. useful for executing with adocommand object
Submitted by
kutsoff
1
Europead date or MSSQL Timestamp
Created
·
2014-10-03 07:57
Flavor
·
PCRE (Legacy)
Matches european dates (DD.MM.YYYY[ HH:MM:SS]) and MS-SQL Timestamp ({ts 'YYYY-MM-DD HH:MM:SS'})
Submitted by
anonymous
1
Match a date in SQL Server format
Created
·
2014-07-23 09:35
Flavor
·
PCRE (Legacy)
no description available
Submitted by
anonymous
Community Library Entry
1
Regular Expression
Created
·
2016-09-08 16:21
Flavor
·
ECMAScript (JavaScript)
/
\s
*
\(
\s
*
(?:
'
[
-
\/
a
-
zA
-
Z
0
-
9
]
{1,40}
'
)
\,
\s
*
\s
*
(?:
'
[
-
\/
a
-
zA
-
Z
0
-
9
]
{1,40}
'
)
\,
\s
*
(?:
'
[
ifbIFB
]
{1}
'
)
\,
\s
*
(?:
'
[
0
-
9
]
{8}
'
)
\,
\s
*
(?:
'
[
0
-
9
]
{8}
'
)
\)
\s
*
\,
\s
*
\n
*
/
Open regex in editor
Description
no description available
Submitted by
mee