Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-23-2015, 06:44 PM   #1
jcambaya
Junior Member
jcambaya began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2015
Device: none
Sigil Regex Title case

Hi Everyone,

Is there a regex that can convert text into Title case in sigil?

From:
<h2>CHAPTER III. LEARNING THE "REGEX" AND MORE</h2>

into:
<h2>Chapter III. Learning the "Regex" and More</h2>

I tried \L \l \U and \u but not working. What is the Regex for doing so?

Thanks!
jcambaya is offline   Reply With Quote
Old 06-24-2015, 01:47 AM   #2
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,313
Karma: 20171571
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
I don't think there is one in Sigil. The best I've come up with is <h2>\L\1\E</h2> which puts them all in lowercase, then you can do multiple cycles of <h2>(.*?) ([a-z])(.*?)</h2> to <h2>\1 \u\2\3</h2>.

It's not perfect, it will miss things like ", III, the, and unless you specifically code for them. I've found it is overall faster if you do the first step for all lowercase, then just manually highlight and use the Ab button.

The better answer is to use Calibre's Book Editor. They have Regex functions that will do that built in.

The BEST answer is to get one of our enterprising coders to get regex functions for Sigil...
Turtle91 is offline   Reply With Quote
Advert
Old 06-24-2015, 04:18 PM   #3
MickiTee
Guru
MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.MickiTee ought to be getting tired of karma fortunes by now.
 
MickiTee's Avatar
 
Posts: 860
Karma: 4097942
Join Date: Jun 2012
Location: London, UK
Device: Sony PRS-505, Pocketbook TL3, TL4, TL5
You could have a look at the sticky thread Regex Examples (https://www.mobileread.com/forums/sho...d.php?t=167971) in this forum.

I'm reasonably sure that there are a number of posts relating to this as I think I used this to create a saved search to change uppercase to title for a single word.
Also there is an example in the saved Clips for this.
MickiTee is offline   Reply With Quote
Old 06-24-2015, 04:47 PM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,685
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by jcambaya View Post
Is there a regex that can convert text into Title case in sigil?
This simple regex will transform upper case words to title case words:

Find:([[:upper:]])([[:upper:]]{2,})
Replace:\1\L\2\E

For more examples, see this old post.
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RegEx Function: Title Case phossler Editor 29 07-04-2020 10:52 AM
Is there a way to remove text from Title with regex LadyKate Library Management 8 02-14-2014 04:12 PM
Regex for Title Case or Sentence case? Turtle91 Sigil 3 01-19-2013 01:36 PM
RegEx for title - author - series? mattam Library Management 10 08-29-2012 11:11 PM
Sigil and Regex crutledge Sigil 2 07-14-2010 04:51 PM


All times are GMT -4. The time now is 05:56 PM.


MobileRead.com is a privately owned, operated and funded community.