This wouldn't scale past double digits.  If you're going to separate it
out you may as well break the minor revisions into it's own variable and
then concatenate/format on output...that would also be more easily used
with a code management system's built in revision tracking (though this
could also be easily used with regex also). 

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
>
>   


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


Reply via email to