Scripting IDEA to do multiple regex replacements in a file

In migrating some code from one environment to another, I need to do a series of regex replacements within a single file, multiple regexes, each with different replacements. I can write external code for this, but it'd be super handy to do it all right there in my editor, as some kind of script. Even handier to be able to set up a number of these as Tools, and just invoke them from a menu.

Is there a way to do any of that within IDEA? Is IDEA scriptable in that sense?

Thanks in advance for any thoughts.

3 comments
Comment actions Permalink

I don't see anything IDE-specific in that task so Groovy console or simple Groovy script shall be enough.

0
Comment actions Permalink

Thanks for the thoughts guys.

Live Plugin seems appropriate, will check it out. I'm not familiar iwth either Groovy or the IntelliJ API, so there's a bit of a curve there, but that's to be expected, not adverse to any of that.

0

Please sign in to leave a comment.