Or
You can also do ...

$string =~ s/(\d+)$/$1+1/e;

Ashok

On 10/10/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> 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...
>
> Hello Tatiana
>
> This will do what you need:
>
> $string =~ s/(Version:\s+\d+\.\d+\.)(\d+)/$1.($2+1)/e;
>
> Rob
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>

Reply via email to