MATLAB: How to use REGEXP to match multi-digit values

MATLABmulti-digit valuesregexp

I've been reviewing the MATLAB Programmer's Guide in hopes of finding a solution to a current problem: How do I use REGEXP to match multi-digit values?
From earlier this year, I have the following commands:
str = 'Part ID: 1 or Part ID: 2 or Part ID: 5 or Part ID: 10';
exp = 'Part ID:\s+([25])\W';
tokens = regexp(str, exp, 'tokens');
Part_data = reshape(str2double([tokens{:}]), 1, []).'
These commands work great when I'm looking to match up single digit values like 2 and 5.
Now, let's use the following updated string and associated commands;
str = 'Part ID: 112 or Part ID: 220 or Part ID: 252 or Part ID: 106';
exp = 'Part ID:\s+([220])\W';
tokens = regexp(str, exp, 'tokens');
Part_data = reshape(str2double([tokens{:}]), 1, []).'
This results in Part_data = NaN
I get the same result when trying to match the value of 112.
If possible, how do I use REGEXP to match only these two multi-digit values?

Best Answer

str = 'Part ID: 112 or Part ID: 220 or Part ID: 252 or Part ID: 106';
exp = '(?<=Part ID:) 220';
m = regexp(str, exp, 'match')