Dr.Ruud wrote:
"Tatiana Lloret Iglesias" schreef:

What regular expression do I need to convert  Version: 1.2.3   to
Version:
1.2.4  ?

I.e.  my pattern is Version: number.number.number and from that i need
Version: number.number.number+1
After the : i can have a space or not...

Why use a regex?

perl -wle '
    $v = 2.1.1;
    printf "%vd\n", $v;
    substr $v, -1, 1, chr ord(substr $v, -1, 1) + 1;
    printf "%vd\n", $v
'

See also version.pm

Because a regex works whereas your option doesn't answer the question.
Show how to use this technique to convert "Version: 1.2.3" to
"Version: 1.2.4".

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to