Path: news.mathworks.com!not-for-mail
From: "Donn Shull" <donn.shull.no_spam@aetoolbox.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sscanf issue with xml-like format
Date: Wed, 1 Oct 2008 17:29:02 +0000 (UTC)
Organization: L &#38; D Engineering LLC
Lines: 26
Message-ID: <gc0c0u$nl1$1@fred.mathworks.com>
References: <gbvvli$osq$1@fred.mathworks.com>
Reply-To: "Donn Shull" <donn.shull.no_spam@aetoolbox.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1222882142 24225 172.30.248.38 (1 Oct 2008 17:29:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 1 Oct 2008 17:29:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 219306
Xref: news.mathworks.com comp.soft-sys.matlab:493137


Hello,

Yes regexprep in R13 may be the way to go:

>> text = regexprep('<A>blabla</A>', '<A>(\w*)</A>', '$1', 'tokenize')

text =

blabla

You may need to tweak the token.

Donn

"E " <ehelden@hotmail.com> wrote in message <gbvvli$osq$1@fred.mathworks.com>...
> In Matlab R13 I'm trying to do the following :
> text = sscanf('<A>blabla</A>','<A>%s</A>')
> 
> which results in : 
> text = blabla</A>
> 
> Obviously I wanted :
> text = blabla
> 
> Any ideas on how to do this ? Is regexp a way out ?