ForNext
Only Do What Only You Can Do
077. recursive regex
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
/\(([^()]*|(?R))\)/
PHP
'/\(([^()]*|($R))\)/'
Python
none
Ruby
Ruby 1.9: /(?<p>\(([^()]*|\g<p>)*\))/