From: Emil Kampp Date: 2011-03-25T08:54:23+09:00 Subject: Re: Regexp, matching only the content within parentheses Thank you, that pointed me in the right direction. But now I'm facing another problem (still kinda the same). I have this string: f_(a)(x)=x^(2)+(5x//f'(x)) Where i need to capture everything within the parentheses surrounding the double-slashes (//), like so: (5x//f'(x)) My problem is that I can't seem to get past the last parentheses around the f'(x). This is what I've gotten so far: (([^(]*)\/\/[^\)]*) And that will match `5x//f'(x`, so I need to get past that last closing parentheses around the x. I hope that someone (Gunther, if you'r still up for it?) can help me. Best regards // Emil -- Posted via http://www.ruby-forum.com/.