Hello all, I was wondering if I could please get some help on the following problem. I need to get a list of numbers out of strings but I don't know how many numbers are in each string. The strings are as follows:
my $line1 = "[HAVE 1324,2,32,324,5,643]
my $line2 = "[HAVE 4,213,5432,4]
I would ideally like to parse each line and have all the numbers of a single line in an array, say
my @numbers =();
After reading the first line, it should contain (1324,2,32,324,5,643) and after reading the second line it should contain (4,213,5432,4). Not sure how to match strings when the format isn't constant.
Thanks in advance for your help,
Matt.