Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
.*?(WHERE.*?)(GROUP BY|;|\n)
/
gs
Test String
New
s = '''FROM clinics INNER JOIN clinic_drug on clinics.clinicId = clinic_drug.clinicId WHERE clinic_drug.amount = 0 GROUP BY clinics.name;''' s = '''FROM clinics INNER JOIN clinic_drug on clinics.clinicId = clinic_drug.clinicId WHERE clinic_drug.amount = 2 GROUP BY clinics.name;''' s = '''FROM clinics INNER JOIN clinic_drug on clinics.clinicId = clinic_drug.clinicId WHERE clinic_drug.amount = 3;
Extraction
Processing...