in reply to Re^2: Help extracting pattern of data
in thread Help extracting pattern of data
Unless the data file you're dealing with is (or is likely to become) quite large (many megabytes), I still think just decoding to a hash would be best.
But if you're committed to regexes (and assuming the entire file content has been slurped into $content), try something like (untested):
my @latestTimes = $content =~ m{ "latestTime \s* : \s* \K \d+ }xmsg;
if you have Perl 5.10+ (for the \K operator) or else
my @latestTimes = $content =~ m{ "latestTime" \s* : \s* (\d+) }xmsg;
Then just repeat for your other fields: eCompressed eUncompressed etc.
Update: But see davido's ++reply above.
|
|---|