View Single Post
Old 10-09-2012, 10:57 AM   #2
Doitsu
Wizard
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: 1,989
Karma: 4633978
Join Date: Dec 2010
Device: Kindle PW2
You need to enclose the chapter number variable in parentheses. (I used \d+ because it searches for numbers.) Try:

Find:
Code:
<p class="heading">(\d+)</p>\n\n  <p>
Replace:

Code:
<p class="heading">\1</p>\n\n  <p class="newscene2">
BTW, since it's a heading, I'd recommend enclosing it in heading tags, which will allow you to automatically generate a TOC in Sigil. You could also combine both headings. For example:

Find:
Code:
<p class="heading">(\d+)</p>\n\n  <p>(.*?)</p>
Replace:
Code:
<h3 class="heading" title="\1  \2">\1<br /><span class="newscene2">\2</span></h3>
Note: The above regex should work in Sigil 0.53 because it automatically adds two spaces and a line break between the two paragraphs. If you use a regular text editor, simply delete the spaces and the line-break characters (\n) in the regexes.

Last edited by Doitsu; 10-09-2012 at 11:05 AM.
Doitsu is offline   Reply With Quote