Page 1 of 1

Regex to find nested if statements

Posted: Mon Aug 31, 2009 9:53 pm
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