我想在某些情况下将小写更改为大写——例如,我想将冒号后的所有小写字母更改为大写。在 RegEx Pal 中,没有单一的规则可以实现这一点,但有一个未记录的功能允许我创建一个简单更改的列表来运行。(注意:有一些正则表达式可以做到这一点,但在 RegEx Pal 中不行。)
# I can use the # to add comments to the list
: a-->: A
: b-->: B
: c-->: C
左侧的内容与右侧的内容通过 --> 分隔
- 保存此文件后,您可以通过在 RegEx Pal 的搜索窗口中输入以下内容来使用它:
-->{Path}\{Filename}
For instance:
-->c:\My Paratext 8 Projects\zzProj\shared\changes.txt
- 当文件运行时,它会突出显示整个章节中找到的文本。如果您在查找/替换中运行它,它会突出显示找到的第一个项目以及剩余的文本,但在替换面板中,它会显示它正在执行正确的替换。由于列表提供了替换内容,替换窗口应保持空白
注意 我对这方面的实验表明,我无法使用复杂的 Unicode 字符。如果我想进行如下更改:
Jesus-->Jesús
我必须将文本文件保存为 ANSI 格式,否则 ú 在文本中会损坏。
另外
虽然我可以包括连字符左侧的空格,但我不能在右侧末尾包含空格——它在处理过程中会被删除。而且,如果我想在左侧搜索句号或问号,这些字符必须先进行转义:
\. a-->. A
\? a-->? A
可能还有其他一些事情不能按预期工作。如果您想尝试此方法,我建议从一个非常简单的列表开始,然后逐步添加内容。
I want to change lowercase to uppercase in certain situations - for instance I want to change all lowercase after a colon to uppercase. There is no single rule that I can use in RegEx Pal to accomplish this, but there is an undocumented feature that lets me create a list of simple changes to run. (NOTE: there are regular expressions that can do this, but not in RegEx Pal.)
- Create a text document with entries that follow this format:
# I can use the # to add comments to the list
: a-->: A
: b-->: B
: c-->: C
What is on the left is separated from what is on the right by -->
- Once you save this file you can use it in the search window of RegEx Pal by typing:
-->{Path}\{Filename}
For instance:
-->c:\My Paratext 8 Projects\zzProj\shared\changes.txt
- When the file runs it will highlight text found in the entire chapter. If you run this in a Find/Replace then it will highlight the first item found and remaining text, but in the replace panel it will show that it is doing correct replacements. The replace window should be left blank since the list is providing the replacement
NOTE My experiments with this showed that I could not use complex Unicode characters. If I wanted to do a change like:
Jesus-->Jesús
I had to save the text file in ANSI format or else the ú would be corrupted in the text.
Also
While I could include spaces on the left side of the hyphen hyphen, I could not include a space at the end of the right side - it would get removed in the processing. And if I wanted to search on the left for a period or question mark, these had to be escaped first:
\. a-->. A
\? a-->? A
There are probably other things that may not work quite like expected. If you want to try this, I suggest starting with a very simple list and then adding to it as you go.
机器翻译自 English