I have this string which consist of :
const string = `
/**
* tests
*/
describe("tests", () => {
it("create a role", async () => {});
});
`;
And i would like to delete the start of this string until the word it(
is found. so i could have in the end something like this :
it("create a role", async () => {});
});
`
I tried working with this regex string.replace(/^(.+?)(?=-it\(|$)/gi, "");
but still nothing works