> I wonder if they used a regex for that?
Not possible. You have to parse the file fully to extract that information; regular expressions aren't powerful enough.
Not possible. You have to parse the file fully to extract that information; regular expressions aren't powerful enough.
And for example, the regex engine from Perl 5.10 and up has had support for recursive patterns. See the faq: http://perldoc.perl.org/perlfaq6.html#Can-I-use-Perl-regular...
And once you have recursion support, you can parse context-free languages.