[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Changeset] Re: Behavior of the matlab regexptranslate function
From: |
John W. Eaton |
Subject: |
[Changeset] Re: Behavior of the matlab regexptranslate function |
Date: |
Mon, 24 Mar 2008 15:55:54 -0400 |
On 23-Mar-2008, David Bateman wrote:
| Ben Abbott wrote:
| > I just finished the install of 2008a. The results from 2008a and 2007b
| > (the same) are below.
| >
| >>> regexp ('file1.mat file2.mat file3.xls file4.mat', ...
| > regexptranslate('wildcard','*.mat'), 'match')
| >
| > ans =
| >
| > 'file1.mat file2.mat file3.xls file4.mat'
| >
| >>> regexptranslate('wildcard','*.mat')
| >
| > ans =
| >
| > .*\.mat
| >
| > Ben
|
|
| Tine to file a bug report against matlab then.. In any case thinking
| further about it replacing '*.mat' with '.*\.mat' makes as much sense as
| replacing it with '\w+\.mat' as otherwise how do you treat filenames
| with spaces in them.. I suspect this is a case of a matlab developer
| trying the write the DoWhatIWantNotWhatIAsked function, and the moral is
| that you should learn the syntax of regexp rather than relying on a
| particular behavior of the regexptranslate function.
|
| In any case I attach a changeset that duplicates the behavior of the
| matlab function.
I applied it.
Thanks,
jwe