Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
Regex to find if/while constructs
Open Workspace
PCRE (Legacy)
Match
Created 2016-02-01 15:13
2
Regular Expression
/
(
^
if
|
^
while
|
[
;}
\n
]
if
|
while
)
[
]
*
(
[
(
]
(
[^
()
]
|
(?2)
)*
[
)
]
)
/
g
Description
Find if/while in JS code written in PCRE
Submitted by
Deepak Subramanian