What will be the regex for this type of string?
1 次查看(过去 30 天)
显示 更早的评论
The regular expression should accept string like:V123456_123456_123456.
- String must start with V.
- Then any number of digits.
- _(underscore) character followed by any number of digits.
- Finally an _ character then any number of digits.
0 个评论
回答(1 个)
Rik
2022-10-21
expr = 'V/d*_/d*_/d*';
Or, if 'any' actually means '1 or more':
expr = 'V/d+_/d+_/d+';
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!