It was certainly useful. Out of my head I said:
"First of all, what have you tried ? We're not a free code writing service. You should know that after almost 2years on SO. Second, it's certainly possible to match nested structures using perl/pcre/.net regex but you should avoid it for two reasons: 1) most of the times there is a parser that does the job 2) The regex is quite complicated and you should master regex otherwise you wouldn't have asked it. Here's a start http://regex101.com/r/uW8uR4, try to understand it