Regular expressions with regexp.
3 次查看(过去 30 天)
显示 更早的评论
I want to separate 8 number together like 20070101, <Year> 2007, <Month>01, <Day>01, how can I do?
0 个评论
采纳的回答
Stephen23
2019-9-28
>> str = '20070101';
>> rgx = '(?<year>\d{4})(?<month>\d{2})(?<day>\d{2})';
>> out = regexp(str,rgx,'names')
out =
year: '2007'
month: '01'
day: '01'
更多回答(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!