[ Ignore this post, I missed how you just want a list of the numbers at the end ]
my %value_lkup = ( A => '1000', B => '2000', ); my $pat = '[' . join('', keys %value_lkup) . ']'; s/($pat)/$value_lkup{$1}/g;
or
s/([AB])/ ( ord($1)-ord('A')+1 )*1000 /eg;
In reply to Re: regex question
by ikegami
in thread regex question
by nate_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |