>>>>> "TJM" == Tad J McClellan <> writes:
TJM> Peng Yu <> wrote:
>> I would like to match
TJM> Then you should type:
TJM> perldoc -q match
TJM> How do I find matching/nesting anything?
>> a pattern such as
>> something( something_1( something_2( ...
>> (something_n)...)something_else_2)something_else_1 )
>>
>> , where all the brackets pair up and there could be any number of
>> pairs. something_1, something_2, ..., and something_n could contain
>> '()' pair as well.
TJM> "This isn't something that can be done in one regular expression, no
TJM> matter how complicated."
that could be done with (??{ code }) which is considered experimental
but 5.10 has (?PARNO) which says it can match nested parens. see perldoc
perlre and look for PARNO. it is still not for newbies and the faint of
heart but it is supported. it is still better/simpler to use a module like
text::balanced to match nested parens.
uri
--
Uri Guttman ------
--------
http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training ---
http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ----
http://bestfriendscocoa.com ---------