From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: String manipulation
Date: Tue, 2 Apr 2013 15:01:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <kjerri$58n$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1364914866 5399 (2 Apr 2013 15:01:06 GMT)
NNTP-Posting-Date: Tue, 2 Apr 2013 15:01:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 4199643
Xref: comp.soft-sys.matlab:792487

I have a cell array of strings that I need to extract substrings from based on the location of hyphens. the array is something like this:
str = {'*88-123-*-001*';

where the * can be any number of characters. I am trying to extract just the numbers. If the strings were the same length identification of the first hyphen and last hyphen could occur followed by conversion to char. 

hyphs = cell2mat(strfind(str,'-'));
out = cellstr(strcat(str2(:,hyphs(1)-2:hyphs(:,1)+3),str2(:,hyphs(end)+1:hyphs(end)+3)));

However with different lengths the indices of the hypens will change from row to row and that wont work properly. I would think there is a way to do this without a forloop but I cant think of it. Any suggestions, Thnx