Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to parse a string? (Simple question)
Date: Mon, 15 Jun 2009 09:47:01 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 12
Message-ID: <h155al$nsi$1@fred.mathworks.com>
References: <h14aa9$5r9$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245059221 24466 172.30.248.35 (15 Jun 2009 09:47:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 15 Jun 2009 09:47:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:547479


Using regular expression:

>> data = '*100#*2001#*ExpParameter:T=1.000000;FSC=1.000000;O=1.000000;AR=0.000000;AFD=500.000000;HFD=1500.000000;JD=500.000000;EOX=-0.960000;EOY=-1.470000;EGX=9.000000;EGY=6.000000;FWD=1.750000;#*111#*2111#*ExpParameter:T=2.000000;FSC=2.000000;O=1.000000;AR=0.000000;AFD=500.000000;HFD=1500.000000;JD=500.000000;EOX=-0.960000;EOY=-1.470000;EGX=9.000000;EGY=6.000000;FWD=1.750000;#*122#*2221#';


>> list=str2double(regexp(data,'(?<=\*)((\d+)(?=\#))','match'))

list =

         100        2001         111        2111         122        2221

% Bruno