Read data from string
Afficher commentaires plus anciens
I have string line:
x='abc123(xyz456)'
How to read information only in brackets, to have result:
y='xyz456'.
Réponse acceptée
Plus de réponses (2)
Azzi Abdelmalek
le 7 Août 2013
y=regexp(x,'(?<=\()[\w]+(?=\))','match')
1 commentaire
Azzi Abdelmalek
le 7 Août 2013
%or
x=x='abc123 (xyz 45_6) ddd (rtr)ccc'
y=regexp(x,'\(([\w\s]+)\)','tokens');
celldisp(y)
Jan
le 7 Août 2013
x = 'abc123(xyz456)';
ini = strfind(x, '(');
fin = strfind(x, ')');
key = x(ini(1) + 1:fin(1) - 1);
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!