regex doesn't work that way.
#!/usr/bin/perl # http://perlmonks.org/?node_id=1210321 use strict; use warnings; while(<DATA>) { my ($first, $rest) = /^(\w+)\s+([-\d]+)/; print "$first $_\n" for $rest =~ /\d+/g; } __DATA__ abcd 723-724 abcde 552-554-553 abcdef 756
In reply to Re: regex problem
by tybalt89
in thread regex problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |