Page 1 of 1

Regex to find nested if statements

Posted: Thu Aug 27, 2009 6:05 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

Posted: Fri Aug 28, 2009 4:01 pm
by Bob
Tricky one.