Extract substring in right format

1 回表示 (過去 30 日間)
DavidL88
DavidL88 2021 年 11 月 9 日
コメント済み: DavidL88 2021 年 11 月 9 日
How can I get the substring 22_right from the string below? The code below give me _22_right. I need it without the first '_'
str = 'Subject160/VSTMB_160_band_resample/data_22_right_average_210225_1827.mat'
EventName = regexp(str,'[1-9_]+_right','match')

採用された回答

DGM
DGM 2021 年 11 月 9 日
Why include the extra _?
str = 'Subject160/VSTMB_160_band_resample/data_22_right_average_210225_1827.mat'
str = 'Subject160/VSTMB_160_band_resample/data_22_right_average_210225_1827.mat'
EventName = regexp(str,'[1-9]+_right','match')
EventName = 1×1 cell array
{'22_right'}
  1 件のコメント
DavidL88
DavidL88 2021 年 11 月 9 日
Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by