How to read only vowels of a string

3 views (last 30 days)
Balkar Singh
Balkar Singh on 24 Apr 2020
Commented: Balkar Singh on 27 Apr 2020
How can I read only vowels of a string by using regular expression in matlab. Thanks in advance.

Accepted Answer

Tommy
Tommy on 24 Apr 2020
Edited: Tommy on 24 Apr 2020
>> regexprep('How to read only vowels of a string?', '[^aeiouAEIOU]', '')
ans =
'ooeaooeoai'
>> char(regexp('How to read only vowels of a string', '[aeiouAEIOU]', 'match'))'
ans =
'ooeaooeoai'
(edit) No longer ignoring capitals!
  6 Comments

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!