http://qs321.pair.com?node_id=100403


in reply to Re: __LANG__Monks slogans
in thread Insert Language Here Monks

RegexMonks: I can do anything...?

<sarcasm>
Write a regex that determines if an arbitrary set of parentheses are balanced within a string. :-)
</sarcasm>

/\/\averick

Replies are listed 'Best First'.
(MeowChow - I am the lizard king...) Re3: __LANG__Monks slogans
by MeowChow (Vicar) on Jul 28, 2001 at 02:04 UTC
    $re = qr/(?:(?>[^()]*)|\((??{$re})\))+/; print 'I (pity (the (fool) who) dont) know (regexes)' =~ /^$re$/;
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print