Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-23-2010, 08:41 AM   #1
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Regular expression for chapter combining

Hello there,

I was wondering if this was possible:

<p>Chapter 1</p>

<p>SUSIE HOMEMAKER</p>

to become

<h1>Chapter 1: SUSIE HOMEMAKER</h1>


I'm stumped as to the find/replace regular expression involved, maybe it's a two-step process. Much karma for any help :-)

Last edited by bremler; 12-23-2010 at 08:44 AM.
bremler is offline   Reply With Quote
Old 12-23-2010, 08:51 AM   #2
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by bremler View Post
Hello there,

I was wondering if this was possible:

<p>Chapter 1</p>

<p>SUSIE HOMEMAKER</p>

to become

<h1>Chapter 1: SUSIE HOMEMAKER</h1>


I'm stumped as to the find/replace regular expression involved, maybe it's a two-step process. Much karma for any help :-)
Sure is possible: do this...

Find: <p>(Chapter \d+)</p>\s+<p>(.*)</p>
Replace: <h1>\1: \2</h1>
Tick the Minimal Matching checkbox
kiwidude is offline   Reply With Quote
Old 12-23-2010, 09:06 AM   #3
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Oh kiwidude that is amazing! Thankyou so much, this has saved me a lot of time.
bremler is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Help Azhad Calibre 86 09-27-2011 02:37 PM
Regular Expression Help iKarampa Calibre 13 12-15-2010 07:17 AM
Regular expression help krendk Calibre 4 12-04-2010 04:32 PM
Regular Expression Help smartmart Calibre 5 10-17-2010 05:19 AM
Help with the regular expression Dysonco Calibre 9 03-22-2010 10:45 PM


All times are GMT -4. The time now is 08:44 PM.


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