I think I might be misunderstanding the problem because it seems straightforward:
foreach (<DATA>) { my ($day) = /(\d+)d/; my ($hour) = /(\d+)h/; $_ ||= 0 foreach $day, $hour; print "Day: ($day) Hour: ($hour)\n"; } __DATA__ 3d 3d 2h 6h
The prints:
Day: (3) Hour: (0) Day: (3) Hour: (2) Day: (0) Hour: (6)
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
In reply to Re: Help with a more precise regex
by Ovid
in thread Help with a more precise regex
by LogicalChaos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |