Posted 20 years ago
by Marianne
Had posted this before but not sure if it was on this forum or the previous one. Would like to see the regex Find/Replace accept a pattern match in the replace field. As it is now, the replace feature (if using regex) is of only limited use.
As a simple example, if I want to change all variable dimensioning from vb to c#, e.g.
Dim x as string
to:
string x
Normally I would do the find like so:
Dim\s+(\w+)\s+as\s+(\w+)
and the replace would be as simple as:
$3 $2
$1 represents the full capture, and $2, $3, etc. is whatever is captured by the parentheses. Since the replace feature doesn't support what is captured by the find, these types of tasks are impossible. Is it possible to add this support to the find/replace feature? Thanks.
As a simple example, if I want to change all variable dimensioning from vb to c#, e.g.
Dim x as string
to:
string x
Normally I would do the find like so:
Dim\s+(\w+)\s+as\s+(\w+)
and the replace would be as simple as:
$3 $2
$1 represents the full capture, and $2, $3, etc. is whatever is captured by the parentheses. Since the replace feature doesn't support what is captured by the find, these types of tasks are impossible. Is it possible to add this support to the find/replace feature? Thanks.
------------------------------- Marianne