Hi, thanks again for the newest enhanced release!
For some info on backreferences see e.g.
http://www.regular-expressions.info/brackets.html
or the PSPad help: http://gogogadgetscott.info/pspad/regexpr.htm
(Section: Metacharacters - Backreferences)

Basically, by surrounding an expression with round brackets - the RE engine
keeps track of this content.
The simplest way to reference it are numbered backreferences (counting the
opening "(" 1,2,... in the expression)

you can use it inside the search string itself (for testing repetition) - this
is allready working in phreplace 
(.)\1
searches for any character folowed by itself 
(.) remembers the content matched by "." 
\1 references the content stored in the first bracket pair
thus using (.)\1 you can find aa, ww, 77, -- etc.

another posibility (which is not working yet) is to use these backreferences for
replacements.

e.g. you can convert

firstVar = 1;
secondVar = 2;
thirdVar = 3;
...
lastVar = 171;

into:

my_firstVar = 1;
my_secondVar = 2;
my_thirdVar = 3;
...
my_lastVar = 171;

replacing:
([^ ]*Var = )
with:

my_$1

($1 inserts the matched content of the first bracket pair while replacing - e.g.
in .NET, probably VB, JavaScript etc.; 
(In Python ...  \1 is used for searching as well as replacing, but it isn't
likely to be the case in your script).

I hope this can help a bit, I belive, this functionality would be allready
"inside" in the used engine, it could be the problem of (un)escaping the $ or
tomething like that...?

-- 
<http://forum.pspad.com/read.php?2,34061,37964>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem