抱歉,我没看到你已经回复了。
编写几个覆盖各种可能性的正则表达式可能是可行的,我不确定。在我参与的项目中,有好几种不同的东西打断了 \wj
对于被节打断的 \wj 标记,我使用的正则表达式是
(\\wj [^\\]+)(\r\n\\v \d+(-\d+)? )
替换字符串
\1\\wj*\2\\wj
在替换字符串中,\\wj 后面有一个最终的空格
基本上,它搜索非标记文本,后跟一个节标记,然后在节标记前关闭 \wj,并在其后重新打开。
另外,如果我没记错的话,如果执行全部替换,你需要多次运行此操作。
BEH
Sorry, I didn’t see that you had replied.
It might be possible to write several that cover the possibilities, not sure. In the project I was working on, there were several different things breaking up the \wj
For a \wj marker that was broken up by verses, the regular expression I used was
(\\wj [^\\]+)(\r\n\\v \d+(-\d+)? )
Replacement string
\1\\wj*\2\\wj
In the replacement string, there is a final space after the \\wj
Basically, it searches for non marker text, followed by a verse marker, and then closes the \wj before the verse marker, and reopens after.
Also, if I recall correctly, if doing a replace all, you have to rerun this multiple times.
BEH
机器翻译自 English