You need '?';

echo 123 | perl -pe 's/(\d?)(\d)/$1.$2/g'

[Jess]

-----Original Message-----
From: Dusan Juhas [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 12:17 PM
To: [EMAIL PROTECTED]
Subject: an error in a simple regexp


Hi,
I typed this simple cmd in the bash:
echo 123 |perl -pe 's/(\d)(\d)/$1.$2/g'
and expected ouput like
1.2.3
but obtained this one:
1.23

What's wrong and how to write a regexp cmd which will
transfer a number to digits with dots in between?
eg: 1234 -> 1.2.3.4
Thanx

Regards,
Dusan


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


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

Reply via email to