The Sigil PCRE library already supports conversion to upper case and lower case with
\U,
\u,
\L and
\l back references.
For example:
Find: <p>(.*?)</p>
Replace: <p>
\U\1\E</p>
Before:
Code:
<p>This is a test sentence.</p>
After:
Code:
<p>THIS IS A TEST SENTENCE.</p>
Find: <h3>([[:upper:]])([[:upper:]]{2,})
Replace: <h3>\1
\L\2
Before: After: Find: <p>(.*?)</p>
Replace: <p>
\u\1</p>
Before:
Code:
<p>this is a test sentence.</p>
After:
Code:
<p>This is a test sentence</p>
These back references are also useful for Project Gutenberg texts with all caps text instead of italics. For example:
Find: ([[:upper:]]{2,})
Replace: <i>
\L\1\E</i>
Before:
Code:
<p>This should be in ITALICS.</p>
After:
Code:
<p>This should be in <i>italics</i>.</p>