Remove parentheses with regexp

18 Ansichten (letzte 30 Tage)
Giorgos Papakonstantinou
Giorgos Papakonstantinou am 14 Jan. 2014
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 '

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 14 Jan. 2014
Bearbeitet: Azzi Abdelmalek am 14 Jan. 2014
a ='0.00 (578)';
regexp(a,'(?<=\()[\d.]+(?=\))','match')

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by