Issue
I have a string to find: [general_options] and used this exp: (\[.*])
in netbeans
However it's finding whole [....] string with bracket and I need only what is inside: general_options, how to do that?
Solution
Either you change your capturing group
\[(.*)]
and get your result from the capturing group 1 (assuming this is the only one)
OR you use lookehind and lookahead assertions (if they are supported)
(?<=\[).*(?=])
Answered By - stema
Answer Checked By - David Marino (JavaFixing Volunteer)