loki has asked for the wisdom of the Perl Monks concerning the following question:
^\s*[)]*\s*$
and
^\s*[(]*\s*$
matches the brackets `(` and `)` which commented as matched. That is, what am trying is to ignore brackets that are single and not (condition1) brackets.. i want to regex to match the brackets which are commented as not matched.. ie 1 or more brackets on the same line..
while ( #matches here ( #matches here (condition1) && (condition2) && condition3 ) || (#matches here (condition4) || condition5 && (condition6) ) #matches here ) #matches here
but if I have like this it does not match:
while (( #does not match here (condition1) && (condition2) && condition3 ) || ( (condition4) || condition5 && (condition6) ) ) #does not match here
or
while ((( #does not match here (condition1) && (condition2) && condition3 )) || (( #does not match here (condition4) || condition5 && (condition6) ) ) ) #does not match here
How can I match all the brackets that are single?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: doubt on regex
by Utilitarian (Vicar) on Jan 25, 2010 at 14:33 UTC | |
|
Re: doubt on regex
by lidden (Curate) on Jan 25, 2010 at 13:07 UTC | |
|
Re: doubt on regex
by JavaFan (Canon) on Jan 25, 2010 at 13:48 UTC |