in reply to Parsing String
my $results = "Home Town, Log in activity: 57 DI activity: 13 FA activ +ity: 13 FAI activity: 4 Login activity: 23 Not Found activity: 4"; my @numbers = split /\D+/, $results; print "$_\n" for @numbers;
If you want to do it with an RE instead, just use the /g modifier in list context like this:
my $results = "Home Town, Log in activity: 57 DI activity: 13 FA activ +ity: 13 FAI activity: 4 Login activity: 23 Not Found activity: 4"; my @numbers = $results =~ m/\d+/g; print "$_\n" for @numbers;
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing String
by Not_a_Number (Prior) on Apr 21, 2004 at 19:03 UTC | |
|
Re: Parsing String
by Belgarion (Chaplain) on Apr 21, 2004 at 18:44 UTC | |
by Anonymous Monk on Apr 21, 2004 at 18:56 UTC | |
by davido (Cardinal) on Apr 21, 2004 at 19:03 UTC | |
by Belgarion (Chaplain) on Apr 21, 2004 at 19:03 UTC |