If the length of the string stays constant, you can do something like this:

$string = 342389842452;
$string =~ s/^\d{8}/00000000/; #replace the first 8 digits
print $string

-----Original Message-----
From: Sethi, Pradeep [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 04, 2002 3:00 PM
To: [EMAIL PROTECTED]
Subject: replacing last 4 digits


Hi,

I have a number 342389842452.

how do a substitute of everything with X but last 4 digits using regular
expressions

like xxxxxxxx2452

Thanks

Prad

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to