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

 채택된 답변

madhan ravi
madhan ravi 2019년 7월 18일
편집: madhan ravi 2019년 7월 18일

0 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2019년 7월 18일

편집:

2019년 7월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by