Notepad++ Find/Replace number with Increment Value

It is not possible with just a regex, but you can use a python script inside Notepad++.

Here are the steps:

  • Install Python Script 1.0.8.0
  • Go to the Plugins -> Python Script -> New Script
  • Select the file name (say, “increment_numbers.py”)
  • Place this script there:

Code:

def increment_after_openparen(match):
    return "({0}".format(str(int(match.group(1))+31))

editor.rereplace(r'\((\d+)', increment_after_openparen)

Then, just evoke this ‘increment_numbers’ script.

Leave a Comment