Regex to find nested if statements

A place to try and solve your RegEx problems.
Post Reply
User avatar
ulm67

Regex to find nested if statements

Post by ulm67 »

Hello
I need to do a regular expression to find two nested if statement(GROUP1), but not to be confused with GROUP2 of the following example:

GROUP1
if condition
line_1 statement
line_2 statement
.
line_n statement
if condition
line_1 statement
...
line_n statement
end if
line_1 statement
...
line_n statement
end if

GROUP2
if condition
line_1 statement
...
line_n statement
end if
line_1 statement
...
line_n statement
if condition
line_1 statement
....
line_n statement
end if

how can I do?
thanks
Post Reply