I'm using WWW::Mechanize to query the Twitter API and storing the (XML) results into @content
Now I want to search through that content for user IDs (the data I want is always stored between <id>...</id>
tags). The following regex works perfectly on a downloaded file:
for ( @content ) {
if (m/<id>(\d+)<\/id>/) {
print "$1\n";
}
}
but it won't work on the @content
array that I create with Mechanize, when it will only give me a single match.
I've tried using the look between method that I found elsewhere on StackOverflow but that seems to have been a red herring:
m/(?<=<id>)(\d{1,})(?=<\/id>)/g
I'm missing something, but (after years of always finding the answer on StackOverflow or elsewhere) I'm stumped. Clearly I don't even know how to ask the correct question. What am I missing? Is it something to do with the way that Mechanize stores the array?