A backslash followed by the match number.

A nice oversimplified example:

Find:
<option>([^0-9]*)([0-9]*)</option>

Replace:
<option value="\2">\1\2</option>

If you do a search for 'Using regular expressions' in the studio docs
you'll find the help for it.

RegEx rocks.

[EMAIL PROTECTED] <> wrote:
> Question for the RegEx gurus out there (and something I
> should have learned years ago!) -  How do you use RegEx
> backreferences in Studio's find and replace?
> 
> I want to use all or part of the matched character string
> from the "Find" in the "Replace"
> 
> eg. say I have this code
> <option>foo 1</option>
> <option>bar 2</option>
> 
> I want to do a regex replace so it ends up as:
> <option value="1">foo 1</option>
> <option value="2">bar 2</option>
> 
> I can write a regex to match the input string ok. It's using
> that match (or part of the match) in the replace that I can't work
> out. 
> 
> Any clues?



-- 
 Lindsay Evans.
 Developer,
 Red Square Productions.

 [p] 8596.4000
 [f] 8596.4001
 [w] www.redsquare.com.au


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to