Remove parentheses with regexp

18 ビュー (過去 30 日間)
Giorgos Papakonstantinou
Giorgos Papakonstantinou 2014 年 1 月 14 日
I have the following string:
a ='0.00 (578)';
How can I use regexp to retrieve what is inside the parentheses?
I have used this
regexp('0.00 (578)', '\S*\s', 'match')
but it gives me:
'0.00 '

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 1 月 14 日
編集済み: Azzi Abdelmalek 2014 年 1 月 14 日
a ='0.00 (578)';
regexp(a,'(?<=\()[\d.]+(?=\))','match')
  1 件のコメント
Giorgos Papakonstantinou
Giorgos Papakonstantinou 2014 年 1 月 14 日
Thank you Azzi!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by