Hi,
I've found and used (successfully
) a regex for UPPERCASE/LOWERCASE using the \U \u \L \l \E markers.
Does anyone know of a way to use regex to transform a selection to sentence case or title case?
I'm trying to make transformation from ALL CAPS at the beginning of sentences (first paragraph) or in headers a little more automated. Sigil makes it very easy to manually change a highlighted range of text, but I was hoping for something I can put in the "replace" portion of the Find/Replace.
Ideally there would be something like \S or \T. e.g.:
Find: (<p class="first">)([[:upper:] \?!'-\.]{2,})([a-z]|</p>)
(selects all uppercase letters until it finds a lowercase letter OR the end of paragraph)
Replace: \1\T\2\E\3 (for Title Case)
Replace: \1\S\2\E\3 (for Sentence case)
I was trying this for sentence case - and it "seems" to work - but it changes the whole document; which is good if you are fixing grammar...
Find: ([\.|?|!])(\s*)(["|“|‘]?)([a-z])
Replace: \1 \3\u\4
Cheers!