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
/
(?<![^\n])(?:(?!\/\/)[^\r\n])*?while[^\r\n]+[\s=(]each[\s(](?!(?:(?!\/\*)[\S\s])*?\*\/)
/
g
Test String
New
// bar bar while (list($key, $value) = each($_GET)) /* some code while (list($key, $value) = each($_GET)) some code */ while (list($key, $value) = each($_GET))
Extraction
Processing...