in reply to Re: Need to calculate IP address
in thread Need to calculate IP address

s/\d+$/ $& ^ 1 /er

A neat solution, of course, but unfortunately it doesn't meet the OP's specs: .5 becomes .4 and .6 becomes .7.

Replies are listed 'Best First'.
Re^3: Need to calculate IP address
by tybalt89 (Monsignor) on Dec 28, 2017 at 19:44 UTC

    I think the example is wrong. What should a 0 become? Or a 9?

      It will never be a 0. If the IP ends in .9, it needs to become .10. .10 would become .9. .29 would become .30, etc.