View Single Post
Old 02-04-2011, 08:51 PM   #5
JeremyR
Guru
JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.JeremyR ought to be getting tired of karma fortunes by now.
 
JeremyR's Avatar
 
Posts: 973
Karma: 2458402
Join Date: Aug 2010
Location: St. Louis
Device: Kindle Keyboard, Nook HD+
Quote:
Originally Posted by frabjous View Post
Regular expression find and replace?

It would depend on the particular system/editor. In Vim I would search for:

^\s*Chapter\s*[0-9XVI]*\s*$

That breaks down like this:
^ = start of line
\s* = any amount (inluding none) of whitespace (spaces, tabs, etc.)
Chapter = the word Chapter
\s* = any amount of whitespace again
[0-9XVI]* = a string of any length consisting only of 0-9 X and V and I
\s* = any amount of whitespace again
$ = the end of the line
And replace with

<h1>&<\/h1>

which is the search pattern but with <h1> HTML tags around it.

Not sure if Sigil supports something like that (I don't use it), but it might. If not, you can use any advanced Text editor.
Thanks! I will probably end up having to try that. I was hoping for a simpler (and more automated) answer, but this is probably as good as it gets.
JeremyR is offline   Reply With Quote