Extract only text between quotes of a string
Mostrar comentarios más antiguos
Folks, could use an assist. New to REGEXP but persistent. Desire only the literal text between quotes for this string:
imt = "e";
[subchunk] = regexp(textline,'\".*?\"','match','ignorecase');
imt = subchunk;
When I return the argument from my readtext file function, and print using disp(imt), I get this:
'"e"'
When I only want:
e
I assume the single quotes are associated with the disp() function?
Respuesta aceptada
Más respuestas (1)
Pierre Harouimi
el 8 de Mzo. de 2022
0 votos
subchunk = extractBetween("'e'", "'", "'")
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!