Thread: Regex
View Single Post
Old 03-04-2012, 02:55 PM   #1
Gunnerp245
Gadget Freak
Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.
 
Gunnerp245's Avatar
 
Posts: 1,169
Karma: 1043832
Join Date: Nov 2007
Location: US
Device: EE, Note 8
Regex

I have a book with 25 chapters where the 'Chapter' is in the same font size as the rest of the text; It looks like this;
<p class="calibre2"> CHAPTER ## </p>, where ## is the number 1 to 25.

I have devised the following which finds all the chapter entries;
<p class="calibre2">\sCHAPTER\s*\d*\s</p>

I would like to replace it with something similar to;
<h2 class="calibre3">CHAPTER ## </h2>, where ## is the number 1 to 25.

But am unable to devise the correct sequence to save the ## from the search function and insert into the replace function. I read about back referencing including viewing "An introduction to regular expressions" and "Using the Search & Replace feature" without success.

Gunnerp245 is offline   Reply With Quote