HTHuse strict; my @check = ('A4:123:C'); my @ranges = ('A0-7:123:C', 'B8-15:456:D', 'A5-7:123:C'); foreach my $check (@check) { my @cp = $check =~ m!(\w)(\d+):(\d+):(\w)!; foreach my $range (@ranges) { if($range =~ m!$cp[0](\d+)\-(\d+):$cp[2]:$cp[3]!) { if($check[0] >= $1 and $check[0] <= $2) { print "$check mathes $range\n"; } } } }
In reply to Re: matching numeric range
by esskar
in thread matching numeric range
by state-o-dis-array
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |