On Oct 10, 2:39 pm, [EMAIL PROTECTED] (Tatiana Lloret Iglesias)
wrote:
> Hi all!
>
> 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...
>
> Thanks!
> T

Solution (example):
#!/usr/bin/perl -w
use strict;
use warnings;

my $version = "Version: 1.2.3";
if ( $version =~ /\w+:\s+\d\.\d\.(\d)/ )
{
    $new = $1 + 1;
    $version = "Version: 1.2.$new";
}
print "\$version=$version\n";


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


Reply via email to