Read data from string
Mostrar comentarios más antiguos
I have string line:
x='abc123(xyz456)'
How to read information only in brackets, to have result:
y='xyz456'.
Respuesta aceptada
Más respuestas (2)
Azzi Abdelmalek
el 7 de Ag. de 2013
y=regexp(x,'(?<=\()[\w]+(?=\))','match')
1 comentario
Azzi Abdelmalek
el 7 de Ag. de 2013
%or
x=x='abc123 (xyz 45_6) ddd (rtr)ccc'
y=regexp(x,'\(([\w\s]+)\)','tokens');
celldisp(y)
Jan
el 7 de Ag. de 2013
x = 'abc123(xyz456)';
ini = strfind(x, '(');
fin = strfind(x, ')');
key = x(ini(1) + 1:fin(1) - 1);
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!