I assume you just want to "nullify" the last 3 digits of your numbers. You could do it with the following code:
hth! Ratamy @strings=("500", "988", "1210", "1300", "2000"); foreach my $in (@strings) { print "$in "; $in =~ s/(\d\d\d)$/000/; # take the last 3 digits, replace them w +ith 000 print "-> $in\n"; }
In reply to Re: String regex replacement
by Ratazong
in thread String regex replacement
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |