Hi there,
I have an issue that will get resolved with a positive answer to this question... please help!
I am currently trying to use RegEx syntax and the RegEx tool to parse an XML file (Yes, I know this isn't advised but here we are lol)
<Layer1>
<Table>
...
</Table>
<Table>
...
</Table>
...
<Table>
...
</Table>
<Layer1>
I have several XML files I need to extract information from. Each XML file has the pattern above but a varying number of tags I require. I use
REGEX_CountMatches([LAYER1_OuterXML], "<TABLE") to determine how many "<TABLE"s will be in the XML, and dynamical create a Regular Expression to insert into a batch macro to update the RegEx Tool (which is set to Output Method: Parse)
i.e.
if there are 2 <TABLE>;
(<TABLE.*?>.*?</TABLE.*?>).*?(<TABLE.*?>.*?</TABLE.*?>)
if there are 3 <TABLE>
(<TABLE.*?>.*?</TABLE.*?>).*?(<TABLE.*?>.*?</TABLE.*?>).*?(<TABLE.*?>.*?</TABLE.*?>) etc
The problem I am getting is that, each time you enclose part of the regular expression in a "( )" , a new output field is correctly created. But when you pass the newly created regular expression into the RegEx tool, you get an error saying that the "hard coded" number of Output Fields (in the RegEx tool located in the Batch Macro) is different to the number of Output Fields I am creating with each update to the regular expression