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!