x';# after regexp
The '+' was telling PERL to group as many numbers as it could into one
substitution.
Brad
> -Original Message-
> From: darren chamberlain [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 12:30 PM
> To: [EMAIL
Fernando <[EMAIL PROTECTED]> said something to this effect on 07/11/2001:
> I have a credit card number that I want to change to email a
> reciept to the customer. This is that I want:
>
> I have this number: e.j. 8578 596 8552
> I want to convert all the number to "x" like that xxx xxx
Now that I've thought about it, try 's/\d/x/g;' -- '+' is unnecessary and
this should work as you want --
- Dwalu
.peace
--
I am an important person in this world -
Now is the most important time in my life -
My mistakes are my best teachers -
So I will be fearles
How about 's/\d+?/x/g;'
- Dwalu
.peace
--
I am an important person in this world -
Now is the most important time in my life -
My mistakes are my best teachers -
So I will be fearless.
- Student Creed
On Wed, 11 Jul 2001, Fernando w
On 11 Jul 2001, Randal L. Schwartz wrote:
> Brett> $num =~ tr/[0-9]/x/;
>
> Why are you changing square brackets to x as well? Got something against
> square brackets?
My mistake. My apologies to the square brackets.
-- Brett
http://www.chapelperilous.net/bt
On Wed, 11 Jul 2001, Fernando wrote:
> I have a credit card number that I want to change to email a reciept to the
>customer. This is that I want:
>
> I have this number: e.j. 8578 596 8552
> I want to convert all the number to "x" like that xxx
>
> when I use this:
>
> $number =
1 8578 596 8552";
my @card = split(" ", $number);
for my $a (0..2) {
$card[$a] =~ s/\d/x/g;
}
print @card;
-Original Message-
From: Guilherme Pinto [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 2:32 PM
To: 'Fernando'; [EMAIL PROTECTED]
Subject: R
> $number = " 8578 596 8552";
> $number =~ s/\d+/x/g;
$number = " 8578 596 8552";
$number =~ s/\d/x/g;
Try without the quantifier for the digit class.
> -Original Message-
> From: Fernando [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 5:31 PM
> To: [EMAIL PROTEC