Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

RegEx bump version number

by ady (Deacon)
on Apr 25, 2007 at 17:28 UTC ( #612060=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    # but this won't compile, --- why?
    #$version =~ s/(\d+\.\d+\.)(\d+)(\.\d+)/{$1}$2+1{$3}/e;
    print $version;
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    
    $version =~ s/(\d+)(?=\.\d+\z)/$1 + 1/e;
    print "$version\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://612060]
Approved by shigetsu
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2022-10-05 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (24 votes). Check out past polls.

    Notices?