P
PugetSoundSylvia
Hello all,
Can anyone give me a pointer on this? I'm pretty sure this can be
done, just not sure how.
In a string, I need to replace all instances of 15 or 16 number
characters with the 11 or 12 "x" characters, then the last 4 digits of
the 15 or 16 number characters. The chunk of number characters may
appear numerous times in the string.
For instance, if I have this:
$PotentialCreditCardData = "bac1984938193829382 099824 3s ";
.... I want to have this
$PotentialCreditCardData = "bacxxxxxxxxxxxx9382 099824 3s ";
Here's what I have so far that doesn't work:
use strict;
use warnings;
my($PotentialCreditCardData);
$PotentialCreditCardData = "bac1984938193829382 099824 3s ";
# $PotentialCreditCardData = "junk 198493819382938 22 ";
# $PotentialCreditCardData = "02m5k2 198493819382938 gg24
198493819382938";
$PotentialCreditCardData =~ s/(\d{11,12})(\d{4})/$1$2/g;
print $PotentialCreditCardData;
thanks for any hints!
Sylvia
Can anyone give me a pointer on this? I'm pretty sure this can be
done, just not sure how.
In a string, I need to replace all instances of 15 or 16 number
characters with the 11 or 12 "x" characters, then the last 4 digits of
the 15 or 16 number characters. The chunk of number characters may
appear numerous times in the string.
For instance, if I have this:
$PotentialCreditCardData = "bac1984938193829382 099824 3s ";
.... I want to have this
$PotentialCreditCardData = "bacxxxxxxxxxxxx9382 099824 3s ";
Here's what I have so far that doesn't work:
use strict;
use warnings;
my($PotentialCreditCardData);
$PotentialCreditCardData = "bac1984938193829382 099824 3s ";
# $PotentialCreditCardData = "junk 198493819382938 22 ";
# $PotentialCreditCardData = "02m5k2 198493819382938 gg24
198493819382938";
$PotentialCreditCardData =~ s/(\d{11,12})(\d{4})/$1$2/g;
print $PotentialCreditCardData;
thanks for any hints!
Sylvia