Help for this page

Select Code to Download


  1. or download this
      my $quote = qr/"[^"]*"/; # Naive
      s{\G((?>.*?(?:$quote|(?=(\(\{|\}\)))))*?)\2}
       {$1 . ($2 eq '(\{' ? '[' : ']')}eg;