[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
I have string like this. D.PRS.WEB.02.10.001.1 and my requirement is
that I want to remove last dot (.) and all the characters/digit after
that dot with the help of regular expression.
If after last dot(.) there are three digit then don't do
anything but if after last dot(.) there are no exactly three digit then
replace that dot(.) and all digits after that dot with space.
s/\.(\d*)$/ length $1 == 3 ? ".$1" : ' ' /e;
Please help.
Why don't you study the docs and try yourself first?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/