我试图搜索所有以特定词首开头且以无重音元音结尾的章节标题。
例如,它应该找到:
\s Ko te ongo tangata langa fale
但不应该找到:
\s Ko te ongo tangata langa falé
我使用了以下正则表达式:
regex:\s Ko te .?[aeiou]\s\
然而,这不起作用:Paratext 确实找到了所有以“Ko te”开头的章节标题,但也找到了那些不以普通元音结尾的标题。对于后者,搜索结果包含了直到下一个以普通元音结尾的章节标题为止的所有文本。例如,其中一个搜索结果是:
\s Ko te fu’u 'akau mo tono fuá \r …. [大量文本] …. \s Ko te fakatokanga
我原本以为使用 *?(非贪婪模式)可以解决这个问题,但显然并非如此。
我也尝试了类似以下的变体:
regex:\s Ko te .?[aeiou]\ (只有错误的匹配)
regex:\s Ko te .?[aeiou]\s*\r\n (没有匹配)
有没有其他有效的方法?
提前感谢!
Paulus+Kieviet
I’m trying to do a search for all section headings that start with certain particles and end with a vowel without accent.
E.g. it should find:
\s Ko te ongo tangata langa fale
but not:
\s Ko te ongo tangata langa falé
I used the following Regex:
regex:\s Ko te .?[aeiou]\s\
However, this does not work: Paratext does find all section headings that start with “Ko te”, but also finds those that don’t end with a plain vowel. For the latter, the search result includes all text down to the next section heading that does end with a plain vowel. For example, one search result is:
\s Ko te fu’u 'akau mo tono fuá \r …. [lots and lots of text] …. \s Ko te fakatokanga
I would have expected that the use of *? (not greedy) would take care of this, but apparently it doesn’t.
I also tried variants like
regex:\s Ko te .?[aeiou]\ (only faulty hits)
regex:\s Ko te .?[aeiou]\s*\r\n (no hits)
Is there another way which does work?
Thanks in advance!
Paulus+Kieviet
机器翻译自 English