octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Behavior of the matlab regexptranslate function


From: Ben Abbott
Subject: Re: Behavior of the matlab regexptranslate function
Date: Fri, 21 Mar 2008 11:17:39 -0700

On Friday, March 21, 2008, at 12:32PM, "David Bateman" <address@hidden> wrote:
>I just looked at the regexptranslate function, as it seems this function
>might be useful. In matlab2007b and the documentation of matlab2008a
>there is an incoherence in the real and documented behavior of this
>function.. Read the documentation and looking at It seems that
>regexptranslate ("wildcard", s) might be trivally written as
>
>regexprep(regexprep(regexprep (s,"\\.","\\."),"\\*",".*"),"\\?",".")
>
>and that is exactly how it works in matlab2007b. However the example for
>2008a at
>
>http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/regexptranslate.html
>
>has the example
>
>files = ['test1.mat, myfile.mat, newfile.txt, ' ...
>'jan30.mat, table3.xls'];
>regexp(files, regexptranslate('wildcard', '*.mat'), 'match')
>ans =
>'test1.mat' 'myfile.mat' 'jan30.mat'
>
>and its states that
>
>regexptranslate('wildcard','*.mat')
>ans =
>\w+\.mat
>
>So what do the "?" and "*" characters really become in matlab2008a after
>the use of regexptranslate? Can someone with a copy on 2008a run a
>couple of tests for me? In any case there is a large discrepancy between
>the matlab documented and real behavior of this function.
>
>D.
>

David, 

I have a license, but have not yet installed it. 

Please post the tests, and if no one steps up, I'll install 2008a and run them.

Ben


reply via email to

[Prev in Thread] Current Thread [Next in Thread]