0
245 次瀏覽

(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 提出 | 245 次瀏覽

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 提出 已提問 7月 4, 2017
0
1 個回答 142 次瀏覽
我有一個正則表達式,可以提取我 Paratext 專案中的所有數字: \\fig .*\\fig\* 我希望有一個正則表達式,能給我相同的圖表清單,但同時包含每個圖表位置的經文參考。 感謝您提供的任何幫助。 John Nystrom
john_nystrom 312 提出 已提問 11月 6, 2024
0
2 個回答 644 次瀏覽
我需要找出每卷書的草稿完成百分比。只要計算每卷書中有多少節包含文字就足夠了。有沒有人能寫出一個正則表達式來完成這個任務? 感謝您提供的任何幫助。 John Nystrom
john_nystrom 312 提出 已提問 8月 21, 2024
0
2 個回答 578 次瀏覽
各位讀者,您好 我想尋找 \fq 後面跟著任意字串(包含 ɛ ɔ ɲ ŋ),直到第一個 \\ft,接著是一個空格,然後後面不跟冒號的情況 範例句子: \fq cintɔnŋ Natan i ta ŋuŋ kɔnkɔli bo Solomani ... ^\:] 貪婪程度太高了 有什麼建議可以將搜尋限制在第一次出現的情況嗎? 提前感謝, Bart
goodgoan 347 提出 已提問 8月 3, 2023
0
2 個回答 528 次瀏覽
我收到一位譯者的這封電子郵件 我雖然能寫出基礎的正則表達式,但認為我可能會遺漏一些可能作為句子結尾的標點符號 請問有沒有人能幫忙? 我希望進行一次最終標點檢查,這不在 Paratext 的標準檢查範圍內 具體來說,我想確 ... 但至少能給我一份比檢查所有節更短的清單 如果你能寫出一些 REGEX 代碼來幫助我,我將非常感激 ) 謝謝, james_post
[Moderator]
james_post
2.1k 提出
已提問 3月 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 位使用者