0
238 次浏览

(Phil Leckrone writes)

a) how much of:

    1. Alpha; 2. Beta; 3. Gamma

will:

   \d.*\d

match?

b) Can RegEx Pal match text that spans more than one verse?

I’m checking a project (the keying in of an older text) where the key-er has started every verse of direct speech with a open quote continuer – which is not in the original, and not correct for this language. If RegEx Pal cannot span verses, I guess there’s no way to fix this automatically … but it will be a lot of work to correct it manually.

较早的帖子 - 以原始语言显示
Paratext 发布 | 238 次浏览

2 个回答

0

(Phil Leckrone writes)

  1. Regular Expressions tend to be “greedy” in general. If you use * then you will continue to search as long as possible until you come to the next item. If you want to make a search “not greedy” then you would use *? to stop after the first possible match.

  2. A regular expression can span verses or other markers - this depends on what you are using to search with. In RegExPal, the “.” stops at a newline. Therefore it won’t span a verse if there is a newline before the \v.

You can make a dot match a newline if you start the regular expression with “(?s)”.

NOTE: if you search using “regex:” in Paratext then the “.” does not automatically stop at a line break. To make it stop at a newline you need to use: “regex:(?-s)”

If you Google “RegEx Cheat Sheet” you can find some useful guides.

较早的帖子 - 以原始语言显示
发布
0

a)

\d.*\d

will match

  1. Alpha; 2. Beta; 3

(and maybe more if there is another number in the text line) since .* is greedy.

\d.*?\d 

will match

1. Alpha; 2

always.

b) Yes. there are many way to span a verse (RegexPal cannot span a chapter)
method 1: use (?s).*?
method 2: use an expression to find everything except the character you want to find and then put the character you want to find after that:

For example, this is how I would start to find double open quote continuers:

(?<=“[^“”]*?)“(?=[^”]*?”)

and then

(?<=“[^“”]*?)“

The first will will not find continuers at the beginning of a chapter nor continuers in chapters that continue to a following chapter
The second will pick up continuers in chapters that continue to a following chapter and then you will need to manually delete the continuer at the beginning of the following chapter.

If there are quotes in footnotes, this may not work properly. One solution would be to change all quotes in footnotes to different characters, then change them back after removing the continuers from the text. This then would be the whole process:

(?<=\\f\s).*?(?=\\f\*):::“ to <<
(?<=\\f\s).*?(?=\\f\*):::” to >>
(?<=“[^“”]*?)“(?=[^”]*?”) to <nothing> (repeat this until no more continuers are found)
(?<=“[^“”]*?)“  Use this to find chapters that begin with continuers and do manual cleanup
(?<=\\f\s).*?(?=\\f\*):::<< to “
(?<=\\f\s).*?(?=\\f\*):::>> to ”
较早的帖子 - 以原始语言显示
(1.8k 分) 发布
已重新显示

相关问题

0
5 个回答 644 次浏览
In our project's Biblical Terms list, I'm looking for an (easier) way to filter for terms which contain too many ... \r\n and filter more specifically that way? Any suggestions?
Mark P 3.2k 发布 提问于 七月 4, 2017
0
1 个回答 142 次浏览
我有一个正则表达式,可以提取我 Paratext 项目中的所有图片: \\fig .*\\fig\* 我希望有一个正则表达式,能给我同样的图片列表,但同时也包含每张图片所在位置的经文引用。 感谢任何帮助。 John Nystrom
john_nystrom 312 发布 提问于 十一月 6, 2024
0
2 个回答 644 次浏览
我需要了解每卷书的草稿完成百分比。统计每卷书中有多少节包含文本就足够了。有人能写一个正则表达式来实现这个功能吗? 感谢大家提供的任何帮助。 John Nystrom
john_nystrom 312 发布 提问于 八月 21, 2024
0
2 个回答 578 次浏览
亲爱的读者 我想找到 \fq 后面跟着任意字符串(包括 ɛ ɔ ɲ ŋ),直到第一个 \\ft,其后跟一个空格,且后面不跟冒号 示例句子: \fq cintɔnŋ Natan i ta ŋuŋ kɔnkɔli bo Solomani ŋununu \ft ... [^\:] 过于贪婪 有什么建议可以限制搜索范围到第一次出现的情况吗? 提前致谢, Bart
goodgoan 347 发布 提问于 八月 3, 2023
0
2 个回答 528 次浏览
我收到了一位译者的这封邮件 我可以写一个简单的正则表达式,但我认为我可能会遗漏一些可能出现在句末的标点符号 有人能帮忙吗? 我希望进行一次最终的标点检查,这不是 Paratext 标准检查的一部分 具体来说,我想确保我们 ... 但至少这能给我一个比检查所有节更短的列表 如果你能写一些 REGEX 代码来帮助我,我将不胜感激 ) 谢谢, james_post
[Moderator]
james_post
2.1k 发布
提问于 三月 30, 2023
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
If anyone destroys God’s temple, God will destroy that person; for God’s temple is sacred, and you together are that temple.
1 Corinthians 3:17
3,045 个问题
6,005 个回答
5,671 条评论
2,026 位用户