MATLAB: How to select strings using regexp

MATLABregexp

I have a cell array with strings. I need to select only those cells which strings start with "HQ" and follow with a number.
Example of accepted strings: 'HQ30', 'HQ100', 'HQ1000'
Example of unaccepted strings: 'ABC50', 'HQLB30', 'UBHQ100' and similar.
I want to do it using regular expresions.
Thanks

Best Answer

v = regexp(cell_array,'(HQ)\d+','match');
Wanted = [v{:}]