|
-
April 18th, 2005, 12:35 PM
#1
Perl Reg Exp Problems
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.
-
April 18th, 2005, 12:44 PM
#2
Re: Perl Reg Exp Problems
Nevermind, I am an idiot and used the class [] instead of ().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|