sjaguar13
April 18th, 2005, 12:35 PM
How do I get the numbers from a string if they are between a the beginning of the line, a comma, or a space, and a space, a comma, or the end of the line? For Example:
12, 3, "asdfasdfasd",0
"asdfasd", 23,3, 10, "023", 0
It should match the 12, 3, and 0 in the first line and the 23, 3, 10, and 0 in the second line.
I tried:
$line =~ /[^,\s](\d+)[$,\s]/g;
It didn't match anything.
12, 3, "asdfasdfasd",0
"asdfasd", 23,3, 10, "023", 0
It should match the 12, 3, and 0 in the first line and the 23, 3, 10, and 0 in the second line.
I tried:
$line =~ /[^,\s](\d+)[$,\s]/g;
It didn't match anything.