Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?: " \s* (?= (?: SELECT | FROM ) ) | (?<! ^ ) \G ) [^"]*? \K ( SELECT | FROM ) # (1)
/
gx
Input 1
1
New
SELECT * FROM main -- will not match (not in a string) "SELECT name FROM main" -- will match " SELECT name FROM main" -- will match """Here is a SQL statement: SELECT * FROM main""" -- no, string does not start with a keyword (SELECT...). "SELECT * FROM table" " SELECT * FROM table"
Extraction