Thread: Regex
View Single Post
Old 03-04-2012, 03:48 PM   #2
JustForFun
Enthusiast
JustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-booksJustForFun has learned how to read e-books
 
Posts: 30
Karma: 752
Join Date: Nov 2010
Device: PB360
Use
Code:
<p class="calibre2">\sCHAPTER\s*(\d*)\s</p>
for search and
Code:
<h2 class="calibre3">CHAPTER \1</h2>
for replace.

If you need more than one part of the searched text, surround each needed part with parentheses. In the replacement, use backslash and number where the number is the result of numbering the parentheses from left to right, starting with one.

Last edited by JustForFun; 03-04-2012 at 03:51 PM.
JustForFun is offline   Reply With Quote