regular expression for matching substring with wildcard
34 次查看(过去 30 天)
显示 更早的评论
Hi,
I would like to find the number of substrings in a string. The substring contains a unimportant character. For example:
string a = 'AFAFABBB' substring: 'AXA' (X represent an unimportant character)
If I use:
regexp(a,'A.A')
in matlab, it returns:
ans = 1
But the correct answer (for my case) should be 1 and 3. How to make that right?
Thanks!
Bo
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!