regular expression for matching substring with wildcard

34 visualizaciones (últimos 30 días)
Bo
Bo el 29 de Nov. de 2011
Editada: Walter Roberson el 28 de Feb. de 2015
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 29 de Nov. de 2011
Editada: Walter Roberson el 28 de Feb. de 2015

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by