I am looking for a regex to replace all members in parentheses if parentheses are not in square brackets.
eg.
(matches) #match [(do not match)] #should not match [[does (not match)]] #should not match
I current has:
[^\]]\([^()]*\) #Not a square bracket, an opening bracket, any non-bracket character and a closing bracket.
However, this still matches the words in square brackets.
I also created a ruble page of my progress: http://rubular.com/r/gG22pFk2Ld
A regular expression is not going to abbreviate it for you if you can enclose square brackets ( see this related question ).
, , () (b) , .
\([^()]*\)(?![^\[]*])
- , ]. (b) - lookbehind ( 1.9 1.8), , (match)], .
]
(match)]
, , , , .
, , , /state _if_in_square_bracket ( 3).
, , . :
[
[[
]]
, [esp]] .