在 PT 中,有没有办法使用正则表达式来查找“A 或 B 或 C 或 D”?如果 A、B、C 和 D 是单个字符,我们可以将它们放在方括号中,但如果 A、B、C 和 D 是较长的字符串该怎么办?PT 有“多个单词”功能,但这只能组合两个单词“A 或 B”。
一种选择是:先查找两个单词,然后查找另外两个单词并“添加到列表”。然而,这给出的命中次数少于总出现次数:如果不同的单词出现在同一节中,它不会给出额外的命中。
具体案例:我想查找 hū 或 huú 或 ulu 或 ulú(均为完整单词)的所有出现。
查找 hū 或 huú:265 次命中。
查找 ulu 或 ulú:76 次命中。
总计:341 次命中。
查找 hū 或 huú,然后查找 ulu 或 ulú 并“添加到列表”:330 次命中。这意味着在浏览此列表时,如果一个 ulu/ulú 和一个 hū/huú 出现在同一节中,可能会遗漏某些出现。
因此我的问题是:可以使用正则表达式(RegEx)进行此搜索吗?
Paulus+Kieviet
Is there a way to find “A or B or C or D” in PT using regex? If A, B, C and D are single characters we can put them between square brackets, but what if A, B, C and D are longer strings? PT has the function “multiple words” but this only has the option to combine two words “A or B”.
One option is: first find two words, then find the other two and “Add to list”. However, this will give less hits than the total number of occurrences: it does not give an additional hit if the different words occur in the same verse.
The case in point: I want to find all occurrences of hū or huú or ulu or ulú (all whole words).
Find hū or huú: 265 hits.
Find ulu or ulú: 76 hits.
Total: 341 hits.
Find hū or huú, then ulu or ulú “add to list”: 330 hits. This means that when browsing through this list, one may overlook occurrences when one of ulu/ulú and one of hū/huú occur in the same verse.
Hence my question: can this search be done with RegEx?
Paulus+Kieviet
机器翻译自 English