I'm using the regular expression shown below to find a given string in a text file. That parts works. The problem is that I need to subtract 7 from the number in that string in the file. My code below is currently just writing SE*[d-]*0001~ to the text file instead of updating it. That makes sense since I put that in the replace portion of the command, but I don't know how to make this work otherwise. Any ideas?
Regex.Replace(File.ReadAllText(file), @"SE\*\d+\*0001~", "SE*[d-]*0001~", RegexOptions.Multiline)
Here is an example of the string I need to subtract 7 from:
I need it to say: