View Single Post
Old 12-13-2010, 04:55 PM   #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,741
Karma: 2208556
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by Fabe View Post
OLD TEXT:
<p>Section 1: Text text text ...</p>

DESIRED RESULT:
<p>Section 1:</p>

<p>Text text text ...</p>

FIND:
<p>Section \d:

REPLACE:
<p>Section ??:</p>\r\r<p>

RETURNS:
<p>Section ??:</p>

<p>Text text text ...</p>

The red question marks represent a number of unsuccessful tries on my part. I wish the replace to use the found data so my numbers increase appropriately. In some instances they go into double digits (e.g. Section 12: )

Can anyone help? Thanks. - Fabe
There's a number of different ways but this should work:
Code:
Find: <p>(Section \d+:) ([^<]+)</p>
Replace: <p>\1</p><p>\2</p>
Make sure you tick the "Minimal matching" checkbox in the options.

Last edited by kiwidude; 12-13-2010 at 05:19 PM.
kiwidude is offline   Reply With Quote