Regular expressions with regexp.
21 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Anderson Oliveira
le 28 Sep 2019
Commenté : Anderson Oliveira
le 28 Sep 2019
I want to separate 8 number together like 20070101, <Year> 2007, <Month>01, <Day>01, how can I do?
0 commentaires
Réponse acceptée
Stephen23
le 28 Sep 2019
>> str = '20070101';
>> rgx = '(?<year>\d{4})(?<month>\d{2})(?<day>\d{2})';
>> out = regexp(str,rgx,'names')
out =
year: '2007'
month: '01'
day: '01'
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!