thecocce / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

Search and replace - regex pattern in replace #332

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using regex in search and replace I'd expect to be able to use group
references in replace pattern, but it does not work as I'd expect, or just
simply not documented, how should be used.

What steps will reproduce the problem?
1. Enter text "rizi-bizi"
2. Using regex option try to search "(zi)-(bi)" and replace it to \2-\1

What is the expected output? What do you see instead?
I'd expect "ribi-zizi" but I got "ri2-1zi"

What version of the product are you using? On what operating system?
1.9.9.7 on Windows XP SP 3

Please provide any additional information below.

Original issue reported on code.google.com by foldvar...@gmail.com on 27 Aug 2009 at 2:38

GoogleCodeExporter commented 9 years ago
I am afraid this is currently not supported.  However, there is an Advanced 
Replace external Tool (Tools, Tools, Advanced Replace) that should do what you 
want.  You may want to look at the help file the topics on External Tools and 
Parameters to understand how it works and to customize it to your own needs.

Original comment by pyscripter on 12 Aug 2010 at 12:20

GoogleCodeExporter commented 9 years ago

Original comment by pyscripter on 8 Jun 2011 at 6:24

GoogleCodeExporter commented 9 years ago
Fixed in version control.

Now substitution of subexpressions works both using the find Toolbar and in the 
Find-in-Files tool.

Use "$2-$1" in your example as the replace expression.

Original comment by pyscripter on 8 Jun 2011 at 6:25

GoogleCodeExporter commented 9 years ago

Original comment by pyscripter on 11 Jun 2011 at 5:11