extracting numeric vulues from cell char

1 次查看(过去 30 天)
hello every one; who can help me how to extract these email addresses from numeric values which placed before @ character:
km={'ibadal202@gmail.com';'qzaman@msn.com';'dfoorno020@msn.com';'myey@hotmail.com';'qkemal@myspace.com';'zvarfi1013@gmail.com';'vlul010@mynet.com';'uwardo@msn.com';'izaman@hotmail.com';'htimiro@myspace.com';'mfoorno@hotmail.com';'uelo@hotmail.com'}
thanks in advance.

采纳的回答

Guillaume
Guillaume 2015-5-14
Regular expressions are very good for this:
km = {'ibadal202@gmail.com'
'qzaman@msn.com'
'dfoorno020@msn.com'
'myey@hotmail.com'
'qkemal@myspace.com'
'zvarfi1013@gmail.com'
'vlul010@mynet.com'
'uwardo@msn.com'
'izaman@hotmail.com'
'htimiro@myspace.com'
'mfoorno@hotmail.com'
'uelo@hotmail.com'};
numasstring = regexp(km, '\d+(?=@)', 'match', 'once') %find sequence of digits immediately followed by @.
numbers = cellfun(@str2double, numasstring)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by