I need a regex to remove last expression between brackets (also with brackets)
source: input[something][something2] target: input[something]
I\'ve tried this, bu
Do not use the g modifier, and use the $ anchor:
g
$
"input[something][something2]".replace(/\[[^\]]*\]$/, '');