Read data from string
古いコメントを表示
I have string line:
x='abc123(xyz456)'
How to read information only in brackets, to have result:
y='xyz456'.
採用された回答
その他の回答 (2 件)
Azzi Abdelmalek
2013 年 8 月 7 日
y=regexp(x,'(?<=\()[\w]+(?=\))','match')
1 件のコメント
Azzi Abdelmalek
2013 年 8 月 7 日
%or
x=x='abc123 (xyz 45_6) ddd (rtr)ccc'
y=regexp(x,'\(([\w\s]+)\)','tokens');
celldisp(y)
Jan
2013 年 8 月 7 日
x = 'abc123(xyz456)';
ini = strfind(x, '(');
fin = strfind(x, ')');
key = x(ini(1) + 1:fin(1) - 1);
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!