MATLAB: Will REGEXP recognize specific characters within parenthesis

MATLABparenthesisregexp

I'm attempting to use REGEXP to match a specific string within a set of parenthesis. The code I'm using is as follows;
str = '(0:20)';
exp = '([\P\0\D\d])';
tokens = regexp(str, exp, 'tokens');
b = reshape([tokens{:}], [ ], 1).';
Data = cell2mat(b);
When executed, Data contains a 1 x 6 array of char: (0:20)
I'm having difficulty in making the expression sensitive to the contents of this array. Specifically, I'm only interested in the data if the value to the left of the colon is a zero.
Is this possible when using \P as part of the expression?

Best Answer

MATLAB's regexp does not know anything about unicode categories. Also, \0 is not a valid unicode category name.
It looks to me as if what you are looking for is:
'\(0:\d+\)'