I have a goto that’s using a regular expression to loop through data. I want to extract all the data between each occurrence but the height is going to be variable.
It can be done with conditions, but as i’m using regular expressions there seems to be no obvious way to do this. When I Googled i found a “findRegExp()” here. But there are only two tiny code snippets and one of them has errors in it.
The findRegExp method is specifically for use in Boundary scripts, not for data extraction. So it’s not going to help you here.
Generally speaking, when you’re extracting text from a variable height area, you will want to do some sort of line repeat on that area. Basically, GoTo some place on the page, then repeat on every line to extract data until some condition is met to exit the loop. That condition may contain the same regex logic as you’re already using for the gotos. In that case, you’d be using javascript based conditions to end the repeat steps.
I did try to use the findRegExp method which does give me the line where the next occurrence is. I could use this to calculate the height in the data.extract but I don’t know how to access the data object.
It returns: [Left=1,Top=18,Right=4,Bottom=18]
How to i access any of these numbers? I have to tried to access it as a javascript object, array and I cant split it as a string. There also appears to be no documentation covering this or if there is it’s too hard to find.