Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The thing is I have no clue how to match all the instances of (\d+) -- maybe with '(,\d+)+'? And I would like to push all the matched numbers into an array using $1, $2, $3.... in order, if that is possible... Any help is appreciated$string = 'Total requests:,20,30,40,50,60' #the list could go on if ($string =~ m/Total requests:,*?(\d+),(\d+),(\d+),(\d+)/) #don't know how to do this if to grep all the numbers in that line
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex help
by kennethk (Abbot) on Nov 12, 2009 at 20:59 UTC | |
|
Re: regex help
by JadeNB (Chaplain) on Nov 12, 2009 at 23:29 UTC | |
|
Re: regex help
by ikegami (Patriarch) on Nov 12, 2009 at 21:06 UTC | |
|
Re: regex help
by oha (Friar) on Nov 13, 2009 at 15:01 UTC |