View Single Post
Old 05-11-2014, 10:46 AM   #20
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
\1 in replace will take the place of whatever regular expression was first in find.

Example
Find
Chapter (.+?)

Replace
-CHAPTER \1-

Will give you -CHAPTER 1- replacing Chapter 1, -CHAPTER 2- replacing Chapter 2 and so on. What it gives you depends on the regular expression. If it is ([a-z]) it will give you a lower case letter. If it is ([0-9]) it will give you a single number.

You can have a series of them and so the second expressions capture would be output by \2.

You don't have to use what is found, so you can just use \2 without \1.
mrmikel is offline   Reply With Quote