Start a new topic

RegEx to replace numbers incrementally

Using a regular expression, is there a way to replace a numeric value with a number that is 1 higher?  So replace 1 with 2, 2 with 3, 3 with 4, etc.

Hi Patrick,

Something like this should do the trick.

First line value to match on 1 replacement value @2

Second line value to match on 2 replacement value @3

Continue this pattern as high as you need to.  No regex needed for these.

Then on the very last line do value to match on @ replacement value -BLANK- with regex turned on to remove the @ symbols and leave only the needed numeric value.



Brilliant - thanks John.

Login or Signup to post a comment