Consider the scenario outlined in the text below
I desire [this]. I also desire [this]. I do not desire \[this]
I am interested in extracting the content enclosed within []
, but not including \[]
. How should I approach this? Currently, I have tried using /\[([^\]]+)\]/gi
, but it seems to match everything instead.