I am using gedit regex plugin (Python style regex). I would like to do some arithmetic operation on a backreference to a group.
PART 1 DATA MODELS Chapter 2 Entity-Relationship Model 27
I would like to change it to be
PART 1 DATA MODELS Chapter 25 2 Entity-Relationship Model 27
My regex is
^(PART.*)\n(.*\s(\d+))\n, and I would like to replace it with
\1 \3-2\n\2\n. But the replacing regex is not right.