regular expression for matching substring with wildcard

35 ビュー (過去 30 日間)
Bo
Bo 2011 年 11 月 29 日
編集済み: Walter Roberson 2015 年 2 月 28 日
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

採用された回答

Walter Roberson
Walter Roberson 2011 年 11 月 29 日
編集済み: Walter Roberson 2015 年 2 月 28 日

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by