Micro Focus QTP (UFT) Forums
how to parse the string, - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: how to parse the string, (/Thread-how-to-parse-the-string)



how to parse the string, - anu05446 - 11-25-2014

I have a code on a webpage in the following pattern::

Code:
for (anything might be here) {
  this is the Start of the parent for loops body

        
        for (anything might be here) {
          this is the Start of the child for loops body

            for (anything might be here) {
                  this is the Start of the 2nd child for loops body
                    
                        if {
                          
                           }     


                     2nd child for loop closes here   }

                  1st child for loop closes here   }

Parent for loop closes here }

I need to extract the body of the first for loop, so I start reading from the first curly braces, what logic should I have to keep reading till the last curly brace (I need to extract the body of the parent for loop, there are multiple parent for loops one after another.