From: "Will Campbell" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Regexp Challenge
Date: Wed, 20 Jan 2010 11:12:51 -0500
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <hj7a1b$487$>
References: <hj5e1c$7oj$> <> <hj5rng$pk6$> <hj6u7p$8cr$>
Reply-To: "Will Campbell" <>
X-Trace: 1264003948 4359 (20 Jan 2010 16:12:28 GMT)
NNTP-Posting-Date: Wed, 20 Jan 2010 16:12:28 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: comp.soft-sys.matlab:600262

>> regexprep(A,'([^/]+/)(?!/)','${strrep($1,$1,'''')}')
> Your REGEXPREP is fine and fast (I think - I do not dare to copy it).
> But it is not nice Matlab poetry.
> It looks like someone has rolled an angry armadillo over the keyboard.
> Not your fault! Jan

I stared at this command for 20 minutes before I finally felt comfortable 
that I understood what it was doing. You're finding character arrays that 
end with a single / and removing them from the returned value, yes?  I agree 
with Jan that it doesn't look pretty to those not versed in regexp.  But I'd 
hardly call it lacking in poetry.  It's an acquired taste, like 
improvisation jazz.

Thanks for the help!