是的,我們確實支援Regex (特別是 Python 風格)。您說得對,像 \p 這樣的反斜線代碼必須用 \ 轉義,使其顯示為 \\p。
以下是一些您可以執行的操作範例:
# 將章節標題中最後一個單字前的空格改為不換行空格。
"(\\s( \S+)+) (\S+\s*\r?\n)" > "\1\u00A0\3"
# 如果您只希望三字母書卷代碼出現在替代頁眉 \h1 欄位中(以協助排版)
"(\\id (...).+\n)" > "\1\\h1 \2\r\n"
# 將章節開頭看起來應該是不斷行段落 \nb 的普通 \p 進行更改
# 在 2CO 2:0; 2CO 7:0; COL 2:0; COL 4:0; HEB 10:0 "\\p" > "\\nb"
# 將 EXO 29:2 開始的段落縮小 2%
at EXO 29:1 "\\p" > "\\p^98"
# 移除 PSA 書卷中 \d 之後的 \b
at PSA "(\\d .+?[\r\n])\\b[\s\r\n]" > "\1"
# 移除 \s 章節標題之後的 \b
"(\\s .+?[\r\n])\\b[\s\r\n]" > "\1"
# 僅針對特定書卷,在引言大綱標題之前插入換頁符
at MAT; ROM; 1CO; PHP; COL "(\\iot )" > "\\pb\r\n\1"
# 僅針對*部分*書卷,如果第 1 章單獨開始於新的一頁,看起來會更好
at MRK; JHN; 1TI; JAS "(\\c 1 ?\r?\n)" > "\\pb\n\1"
# 換行過長的 \io 行:
at MRK in "\\io\d [^\\]+\\ior": "ఆని పణిఙని" > "ఆని\u2028పణిఙని"
at LUK in "\\io\d [^\\]+\\ior": "బోదిసి, జబ్బుది" > "బోదిసి,\u2028జబ్బుది"
# 在 \io1 和 \io2 的章:節範圍前插入由幾個空格包圍的破折號
# 注意,這使用了 IN 語法,將更改限制為僅在指定的上下文內發生。
# 這是一個非常有用的技巧,通過首先指定規則可以應用的位置,使複雜的規則變得簡單得多。
in "\\io\d .+[\r\n]": "\s([0-9]+:[0-9:\-]+)" > "~~\u2014~~\1"
# 使用小型大寫字母代替全大寫字母
"CHAKRAMANG" > "\\sc Chakramang\\sc*"
at EXO 3:14 "IAWNGUOWI" > "\\sc Iawnguowi\\sc*"
at EXO 28:36, 29:6 "CHAKRAMANG VÜI CHIMSAIMA" > "\\sc Chakramang Vüi Chimsaima\\sc*"
# 將這些段落*縮小 3%
# (*實際上,是下一個節之前的 \p 被縮小)
at LEV 7:10; 13:44; 14:0; 16:19,22; 20:13,18; 24:0; 26:26; 27:8 '\\p(\s)' > '\\p^97\1'
上述大部分內容都記錄在這些幻燈片 中,位於這個龐大的幻燈片堆疊內。
Yes, indeed, we do support Regex (and specifically the python flavour). You are correct that backslash codes such as \p must be escaped with a \ so that they appear as \\p.
Here are some examples of the kinds of things that you can do:
# Make space before last word in a section heading a Non-breaking space.
"(\\s( \S+)+) (\S+\s*\r?\n)" > "\1\u00A0\3"
# If you only want the 3-letter book code to appear in the alternate header \h1 field (to help with typesetting)
"(\\id (...).+\n)" > "\1\\h1 \2\r\n"
# Change any normal \p at the start of chapters which really look like they should be no-break paragraph \nb
# at 2CO 2:0; 2CO 7:0; COL 2:0; COL 4:0; HEB 10:0 "\\p" > "\\nb"
# Shrink the paragraph starting at EXO 29:2 by 2%
at EXO 29:1 "\\p" > "\\p^98"
# Remove the \b after a \d within the book of PSA
at PSA "(\\d .+?[\r\n])\\b[\s\r\n]" > "\1"
# Remove \b after a \s section heading
"(\\s .+?[\r\n])\\b[\s\r\n]" > "\1"
# Just for certain books, insert a page break BEFORE the title of the Introductory Outline
at MAT; ROM; 1CO; PHP; COL "(\\iot )" > "\\pb\r\n\1"
# Only for *some* books, it looks better if chapter 1 starts on its own page
at MRK; JHN; 1TI; JAS "(\\c 1 ?\r?\n)" > "\\pb\n\1"
# Wrap \io lines that are too long:
at MRK in "\\io\d [^\\]+\\ior": "ఆని పణిఙని" > "ఆని\u2028పణిఙని"
at LUK in "\\io\d [^\\]+\\ior": "బోదిసి, జబ్బుది" > "బోదిసి,\u2028జబ్బుది"
# Insert an em-dash surrounded by a couple of spaces before the ch:vs range of \io1 and \io2
# Note that this uses the IN notation, which restricts the change to only happen WITHIN the context specified.
# This is a very useful trick to make complex rules much simpler by specifying where they can apply first.
in "\\io\d .+[\r\n]": "\s([0-9]+:[0-9:\-]+)" > "~~\u2014~~\1"
# Use Small-caps instead of ALLCAPS
"CHAKRAMANG" > "\\sc Chakramang\\sc*"
at EXO 3:14 "IAWNGUOWI" > "\\sc Iawnguowi\\sc*"
at EXO 28:36, 29:6 "CHAKRAMANG VÜI CHIMSAIMA" > "\\sc Chakramang Vüi Chimsaima\\sc*"
# Shrink these paragraphs* by 3%
# (*actually it is the \p which appears before the NEXT verse which gets shrunk)
at LEV 7:10; 13:44; 14:0; 16:19,22; 20:13,18; 24:0; 26:26; 27:8 '\\p(\s)' > '\\p^97\1'
Most of the above is documented in the slides within this massive slide stack.