How to select strings using regexp?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Peter Valent
il 18 Lug 2019
Modificato: madhan ravi
il 18 Lug 2019
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 Commenti
Risposta accettata
madhan ravi
il 18 Lug 2019
Modificato: madhan ravi
il 18 Lug 2019
v = regexp(cell_array,'(HQ)\d+','match');
Wanted = [v{:}]
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!