I'm sorry, I did not practice before posting. I originally had a similar idea, but I do not know how to replace only one search result and get the replaced content. I think my idea can not be achieved, so I come here Post for help. When I see Thaddy's reply, I want to write out my rough idea first, and then ask "How to replace only one search result and get replaced content", but when I wrote that, I found that I can use "ReplaceRegExpr(Pattern, expr.Match[0], ReplaceStr, true)" to achieve, so I continue to write it, and then come back to reply, but I do not know if this code will run perfectly correctly, because "expr.Match[0]" loses its context, I do not know if "ReplaceRegExpr" will get exactly the right result.
I'm very sorry, Thaddy and Martin_fr, I will think carefully and practice seriously before posting at next time. thank you both for your help!