View Single Post
Old 05-14-2017, 11:36 AM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,363
Karma: 20212733
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
If you have any spans with spaces, or any character other than A-Z, then you would also have to check for that. You can also do it with two passes:

pass 1
search:
<span class="smcpIncise">(.*?)</span>

<span class="smcpIncise">\L\1\E</span>

pass 2
search:
<span class="smcpIncise">(.*?)</span>

replace:
<span class="smcpIncise">\u\1</span>


This two-pass technique can be saved as a "Saved Search" and run together with a single click.


After that you would need to individually check each span for words you wish to be capitalized like proper names, "I", "I've", "I'm", etc. Although you can create individual S/R for a bunch of those.

It would be really nice if we could have some kind of "Sentence case" or "Title Case" functionality in the S/R, but as I understand it, Sigil's flavor of Regex doesn't support that. If you absolutely need to have it, then you could try Calibre Editor which has the ability to do Regex Functions.

edit: You can get a "Sentence case" like effect by modifying Doitsu's search slightly. Adding a space or punctuation capture into the second group works well:

Code:
search:
<span class="smcpIncise">([[:upper:]])([[:upper:][:space:][:punct:]]{2,})</span>

replace:
<span class="smcpIncise">\1\L\2\E</span>
Cheers,

Last edited by Turtle91; 05-14-2017 at 12:27 PM.
Turtle91 is offline   Reply With Quote