in reply to regex help
if ($string =~ m/Total requests:/) { @array = split /,/, $string; }
rather than trying to do a match and capture at the same time. If you have your heart on capturing things in a regular expression, you could do
if ($string =~ m/Total requests:/) { @array = $string =~ /(\d+)/g; }
But I'm willing to bet that your life would be easier with just a CSV-parsing module.
Incidentally, your suggestion of (\d)+ will not work because you will repeatedly overwrite your result and hence will only get the last match (60 in your example).
|
|---|