3

I am new to Regex and I would like to replace all occurrences of \\.\CNCBx with \\.\CNCBx+8 where x in an integer.

E.g.

serialPort = \\.\CNCB2
serialPort = \\.\CNCB50

Will change to:

serialPort = \\.\CNCB10
serialPort = \\.\CNCB58

I was trying several patterns but can't get it to work:

Find: CNCB(\d*)

Replace with: ($LAST_SUBMATCH_RESULT) + 8 Doesnt work.

If its not possible I will just use python to do it, but I just wonder if it is possible in Notepad++.

Ofiris
  • 6,047
  • 6
  • 35
  • 58

0 Answers0