comby
A code rewrite tool for structural search and replace that supports
...Use lightweight templates to easily search and change code, HTML, or JSON. Comby is designed to work on any language or data format. Perform richer search and replace because Comby understands the syntax of code blocks, strings, and comments for your language. Comby is ideal for touching up pieces of code. Use it to translate code like this Python 2 to 3 fixer on the right to replace deprecated methods. Easily write one-off refactors or a collection of quick fixes customized to your project. Comby makes finding and changing code easier than regex alone allows and avoids pitfalls like escaping parentheses, quotes, or multiline changes.