如何删除Lua中括号内的文本?

vlg*_*789 3 regex lua gsub

我有一个像"Text the I need (extra descriptor) text"我想要的文字"Text the I need text".

我试图使用str:gsub('\([^)]*\)', "")但由于某种原因无法工作

Ego*_*off 6

试试这个:

str = str:gsub('%b()', '')
Run Code Online (Sandbox Code Playgroud)