Irfan Sayed wrote:
Hi All,
Hello,
need help on regular expression.
i have string like this
"ProductName" = "8:EXFO RTU System 1.2.42"
now i want regular expression in such a way that it will change the line to :
"ProductName" = "8:EXFO RTU System 1.2.43"
$ perl -le'
$_ = q["ProductName" = "8:EXFO RTU System 1.2.42"];
print;
s/(\d+)(\D*)$/ $1 + 1 . $2 /e;
print;
'
"ProductName" = "8:EXFO RTU System 1.2.42"
"ProductName" = "8:EXFO RTU System 1.2.43"
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/