我想我至少对这个问题有几个答案:
我的大部分问题实际上是由我运行的一个自定义脚本引起的。在末尾而不是开头运行该脚本,使得我的 changes.txt 编辑得以生效。我不确定为什么,但这似乎是答案。
另外,我认为 "." 无法捕获换行符。[.\r\n] 和 [\s\S] 似乎都能捕获所有内容。
出于某种我完全无法理解的原因,这个成功了:
'\\v \d+ LATER([\s\S]*?)(?=\\v)' > ''
但这个没有成功
'\\v \d+ LATER([\s\S]*?)\\v' > '\\v '
[题外话:我真的很怀念论坛允许使用 Markdown 的时候。]
I think I have at least a few answers to my question:
Most of my problem was actually caused by a custom script I was running. Running the script at the end, rather than the beginning, allowed my changes.txt edits to take place. I'm not sure why, but that seems to be the answer.
Also, I think that "." doesn't capture new lines. Both [.\r\n] and [\s\S] seem to work to capture everything.
For some reason that I really don't understand, this worked:
'\\v \d+ LATER([\s\S]*?)(?=\\v)' > ''
but this didn't
'\\v \d+ LATER([\s\S]*?)\\v' > '\\v '
[Side rant: I really miss when the forum allowed Markdown.]
机器翻译自 English