I am not a computer professional, only like to develop my own toys.
I am using Globi Flow to get the info I need from the XML file. All is done, except for one instance where I do not have the closing tag
Regular node with closing tag:
<proper price>$4</price>
Below is the code used for all data extraction.
preg_match_all_gf("/<city>(.*?)<\/city>/ism", [(variable)token],4)
This would get the 4th occurrence.
And this is what I currently need and it does not have the closing tag:
<comp score:"9.0">
I managed to get the first digit (in the example above, 9) using Regex, as it can be seen here.
The code used is:
preg_match_all_gf('/(?<=score=")[^"]*(?=.0")', [(Variable) xml],2)
If you remove "*" it gets only the first occurence:
preg_match_all_gf('/(?<=score=")[^"](?=.0")', [(Variable) xml],2)
So now the problem: the iteration can go up to 25.
It takes ALL the correct numbers (score) I need. Either altogether, or just the first one.
Final goal:
city1, address1, state1, price1, etc.1, score1 (current problem).
city2, address2, state2, price2, etc.1, score2
And so forth.
I am not able to pull one score at a time for the right order, because it seems not to accept the the pre-match syntax - more specifically, the offset.
Any idea? Thank you so much for any help!