Remove parentheses with regexp

16 vues (au cours des 30 derniers jours)
Giorgos Papakonstantinou
Giorgos Papakonstantinou le 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 '

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 14 Jan 2014
Modifié(e) : Azzi Abdelmalek le 14 Jan 2014
a ='0.00 (578)';
regexp(a,'(?<=\()[\d.]+(?=\))','match')
  1 commentaire
Giorgos Papakonstantinou
Giorgos Papakonstantinou le 14 Jan 2014
Thank you Azzi!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by