Thank you very much for your response.

first sorry for typo, i want to change 9/9/1973 to 09/09/1973, i.e. add 0 to
month & date, if day/month is 1 digit long.

and I want to use regexp , without using sprinf.

I want to thank this list, I got so many different ways.

Also want to mention, I liked :

s/\b\d\b/0$&/g;

Regards

Pradeep


-----Original Message-----
From: [EMAIL PROTECTED]
To: Pradeep Sethi
Sent: 2/2/02 7:00 AM
Subject: Re: substitution question

The following message is a courtesy copy of an article
that has been posted to perl.fwp as well.

>>>>> "Pradeep" == Pradeep Sethi <[EMAIL PROTECTED]> writes:

Pradeep> I want to change date 9/9/1987 to 09/09/1973

Pradeep> was wondering, what is the most efficient way ?

$date = "09/09/1973";

Since you gave no "rules" by which to generalize this, I'm allowed
to be specific.

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!

Reply via email to