I'm looking for a software development tool that will allow me to rewrite small pieces of code.
For example, if I have the following code:
and would like to rewrite it as:
var f = foo(a) var b = bar(xyz) quux(f, b)
The tool will allow me to write a small regular expression to match the parts of the first
quux call and rewrite it as the second. I have to repeat this process many times in several files. I would like to select each occurrence and tell the tool to process it. The tool should also allow me to save the replacement patterns.
The tool does not have to have full "re-factoring" ability, nor does it have to understand the syntax or semantics of the code. It should just treat the code as text to be edited.
Ideally, the tool will be a plugin for IntelliJ, Eclipse, or Sublime Text 2. FOSS is best, but a small, reasonable price is also acceptable.