My original string :
[Abc ](https://quiz.com?/quiz_id=2/quiz_name=15/level=null)
i tried with this javascript formula but no luck
string.replace(/ *\[[^\]]*]/, '')
How can i remove string between first [ and last ]?
Thank you so much
My desired output is url
https://quiz.com?/quiz_id=2/quiz_name=15/level=null
>Solution :
Just use .* instead of [^\]]*, so the match won’t stop at the first ].
let string = '[Abc ](https://quiz.com?/quiz_id=2/quiz_name=15/level=null)';
let result = string.replace(/\[.*\]/, '');
console.log(result);