Quote:
Originally Posted by Bozana
I've tried everything above... I need to have a search and replace uppercases in the beggining of a paragrahs. Example:
<p class=subsq">SARAH SNUGGLED DEEPER into Kade’s embrace.</p>
And I need it to be:
<p class=subsq">Sarah snuggled deeper to Kade’s embrace</p>
|
For your very specific case, if you know you always have the first few words ALL CAPS in your book...
You could do something like:
Find: <p class="subsq">([A-Z])([A-Z’ ]{2,})
Replace: <p class="subsq">\1\L\2
This would find:
- Grab the very first capital letter.
- Grab all the other capital letters + apostrophes + spaces.
And then replace:
- The very first letter as is.
- Lowercase all the rest of the letters and shove them in.
But I would be very careful with this type of stuff, which is why I do a case-by-case basis replace.
There are TONS of capitalization exceptions that can occur, like:
- First/Last Names
- Roman Numerals
- Acronyms
- [...]
so you can't just "lowercase everything".
Since this ol' 2014 post, I've since explained and cover tons of ALL CAPS -> Smallcaps + Title Casing stuff:
If you type this into your favorite search engine:
Code:
smallcaps Tex2002ans site:mobileread.com
or:
Code:
acronyms Tex2002ans site:mobileread.com
you can find lots of previous discussion.
Quote:
Originally Posted by Bozana
But realised that this works best in Sigil and not Calibre. And this this needs to work in Calibre please. Any help and suggestions would be appricated.
|
Yes, like Doitsu said...
In Calibre, there is a "Regex-Function" Mode now:
There is already a built-in "Lower-case" one.
And, in Sigil, there is now a much more powerful, bleeding-edge, List-Based Search/Replace.
I brainstormed a much faster ALLCAPS-><span class="smallcaps">Smallcaps</span> workflow back in:
but I have yet to write a tutorial on it.
(There have been lots of enhancements in the past
9 years since this original post!!!)