in reply to Regex required to Replace the array specifiers in a string
$_ = "TestVar(Test1->(xy))->Var2(Test2(10)(12))->Finalvar"; 1 while (s/\([^()]*\)//g); print;
I repeatedly substitute matched sets of parentheses to blank strings, where I ensure the parentheses do not contain other parentheses Using character classes. See perlretut for more info.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex required to Replace the array specifiers in a string
by anandvn (Novice) on Jul 02, 2010 at 14:47 UTC |