Home > Back-end >  Editing multiple files
Editing multiple files

Time:09-26

I have the following problem:

I want to add the same text to multiple files. Specifically, I want to add an extension to a .dart file I'm not sure if there is already a pre-defined way for this in JetBrains' products (maybe not, but Android Studio for example).

class <classname> <add text here> //like in my case extends Class

The process would be

  1. I select a bunch of files
  2. I define my text I want to add
  3. To all the files where it finds class it skips the next word and inserts the input.

If you wanted to achieve this without manually copy-pasting, how would you do it?

CodePudding user response:

Thanks @LazyOne

With your suggestion, using the following regex solved the problem

(class)(\s.*)(\{)

replace with

$1$2extends <class>$3
  • Related