remove everything within  /[[^]*]/g
Im trying to remove everything that is inside this: 
To example [abcd]word[efg] should be word. I tried to replace it like this but its not working for some reason. Does anyone know how to fix that?
string = '[abcd]word[efg]'; string = string.replace(/[[^]*]/g,""); console.log(string);
Source: JavaSript – Stack OverflowNovember 27, 2021