Regex to find nested if statements

Tool for Search and Replace across multiple files.
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
User avatar
Bob

Post by Bob »

Tricky one.
Post Reply