Yes you're right... I think for this you need to match nested parentheses and such, and Regular expression is not the best tool for that.

http://stackoverflow.com/questions/1...ested-patterns
deliteblogger Reviewed by deliteblogger on . JQuery and RegExr Help :| Hi guys. I have really big difficulties of doing the following so any help would be appreciated. Here's my stack $(document).test(1000).mouseover(function(){ alert(1); alert(2); }); $(document).inbetween(); Rating: 5