Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Regexp Challenge
Date: Wed, 20 Jan 2010 03:02:08 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 3
Message-ID: <hj5rng$pk6$1@fred.mathworks.com>
References: <hj5e1c$7oj$1@fred.mathworks.com> <77d74c77-3913-4ad5-b40b-fc063a9aa07f@p8g2000yqb.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1263956528 26246 172.30.248.38 (20 Jan 2010 03:02:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 20 Jan 2010 03:02:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:600091

Another approach:

regexprep(A,'([^/]+/)(?!/)','${strrep($1,$1,'''')}')