How to select strings using regexp?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
madhan ravi
2019년 7월 18일
편집: madhan ravi
2019년 7월 18일
v = regexp(cell_array,'(HQ)\d+','match');
Wanted = [v{:}]
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!