How can I do my operation only on lines that close their brackets?
For example I want to change ".is" lines and add a bracket but not for lines with unclosed brackets.
so these are changed
this_thing.is 24  ->   (this_thing).is 24
that.is 50        ->   (that).is 50
a[23].is == 10    ->     a[23].is == 10
a.is true         ->   (this_thing).is 24
this_thing.is 24  ->   (this_thing).is 24
but these aren't:
this_thing.is (24
((that).is 50
(a[23].is == 10
a.is ( true
(this_thing.is 24
ideally also (not)
a{.is true
this_thing{.is 24
and (not)
a[.is true
this_thing[.is 24 
I have a matcher with /.is/ but how to match unmatched brackets?