抱歉,我沒看到你有回覆。
可能可以撰寫幾個正規表達式來涵蓋各種情況,我不確定。在我處理的專案中,有好幾種不同的東西打斷了 \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