I have example text:
var text = `class Eee {
test(){
console.log("123");
}
}
use(123, Eee);
class Ttt {
test(){
console.log("123");
}
}
use(456, Ttt);
class Ooo {
test(){
console.log("123");
}
}
use(111, Ooo);
`;
And I wont get part text for example:
`class Ttt {
test(){
console.log("123");
}
}
use(456, Ttt);`
If I use RegEx:
let result = text.match(/^class Ttt \{(.*)/gm);
I have result: [ 'class ttt {' ]
If I use RegEx:
let result = text.match(/^class Ttt \{(.*)\}/gm);
or
let result = text.match(/^class Ttt \{(.*)use\([\b].Ttt\);/gm);
I have result: null.
How can I get the entire piece of text I want, not the first line?