View Single Post
Old 02-05-2014, 01:42 AM   #3
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
I actually use this one. It seems to suit me well. It fails on accented characters though, so it could be more robust (I just haven't gotten around to updating it). Also, it doesn't work specifically on <h1>, it just works on all words that are in ALL CAPS.

Search: (\b)([A-Z])([A-Z]+)
Replace: \1\2\L\3

It is really helpful when I want to change the text that appears in the Sigil auto-generated TOC, but want to leave the displayed text as ALL CAPS.

Blue: \b is called a "word boundary". For more info on this, see: http://www.regular-expressions.info/wordboundaries.html
Green: This captures the first capital letter of the word. It makes sure it stays capital in the replace.
Red: This captures all the other capital letters, and replaces them with lowercase.

(NEVER Replace All while using this, always replace one by one)

Example:

Code:
<h1 title="1. THIS IS CHAPTER ONE">THIS IS CHAPTER ONE</p>
After:

Code:
<h1 title="1. This Is Chapter One">THIS IS CHAPTER ONE</p>
As I go along, I just manually replace the Title Case words that should be completely lowercase (and, for, is, ...):

http://grammar.about.com/od/grammarf...italstitle.htm
Tex2002ans is offline   Reply With Quote