MATLAB: Skip commas in brackets regexp

MATLABregexpstrsplit

Hi All
I am trying to split a string, but need to skip strings within brackets, and keep this as one entity. How can I split the following
A,VC,D,XO(12,13,14,15),DX,DY
using strsplit, so that XO(12,13,14,15) is not split at the commas. I would therefore like to ignore the content inside the brackets.
Any help would be appreciated.
Etienne

Best Answer

S = 'A,VC,D,XO(12,13,14,15),DX,DY';
regexp(S,'\w+(\([^)]+\))?', 'match')