I have files like this:
class SomeClass
extends anotherClass
with moreClassA
with moreClassB {
//do some crazy stuff
}
I'd like to add one more class to it like this:
class SomeClass
extends anotherClass
with moreClassA
with moreClassB
with oneMoreClassIwant {
//do some crazy stuff
}
I tried to use sed for replacing like this:
sed -E "s/(Class SomeClass[A-Za-z \n]+)\\{/\1with OneMoreClassIWant/" tmp.scala
but it doesn't work for multi-line matching.
I also noticed an example from this post but failed to adapt it to my case.