Locating multiple nested If statements using regular expressions
- by TERACytE
Is there a way to search for multiple nested if statements in code using a regular expression?
For example, an expression that would locate an instance of if statements three or more layers deep with different styles (if, if/else, if/elseif/else):
if (...) {
<code>
if (...) {
<code>
if (...)
<code>
} else if (...) {
<code>
} else {
<code>
}
} else {
<code>
}