MATLAB: How to use regexp to break a string based on the first set of parentheses

regexp

Hello,
I am trying to break a series of strings containing similar patterns into two parts.
Example of the string: "@(a23bcd)e5./(f+g)"
I would like the first part to be what appears inside the first set of parenthesis after the @ sign "a23bcd" and the second part to be everything afterwards "e5./(f+g)".
Currently I am using:
regexp(str,'@\((.*)\)(.*)','tokens','once')
however it gives me everything from the very first parentheses to the very last. "a23bcd)ef./(f+g"
What expression do I need to get everything within the first instance of parentheses followed by what ever appears afterward (including parentheses)?
Thanks

Best Answer

solution:
str="@(a23bcd)e5./(f+g)";
answer=regexp(str,'@\(([^\)]+)\)([^\n]+)','tokens');
firstpart=answer{1}{1}
secondpart=answer{1}{2}