[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strsplit needs an update
From: |
Ben Abbott |
Subject: |
Re: strsplit needs an update |
Date: |
Wed, 27 Mar 2013 21:16:34 -0400 |
On Mar 27, 2013, at 2:19 PM, Jordi Gutiérrez Hermoso wrote:
> On 27 March 2013 14:07, Ben Abbott <address@hidden> wrote:
>> On Mar 27, 2013, at 12:50 PM, Jordi Gutiérrez Hermoso wrote:
>>
>>> So this is why it's always an annoyance to try to implement something
>>> before Matlab... We've had strsplit since 2009 in Octave, and in 2013,
>>> TMW finally implements it themselves, with a differing calling form
>>> than ours:
>>>
>>> http://www.mathworks.com/help/matlab/ref/strsplit.html
>>>
>>> Anyone feel like chasing after this?
>>
>> Looks like a wrapper around regexp.
>>
>> [c, matches] = strsplit (str, delimiter, name, value)
>>
>> [c, matches] = regexp (str, delimiter, 'split', name, value);
>>
>> Any info on what "name", "value" pairs are supported?
>
> They list two options further down, "CollapsibleDelimiters" and
> "DelimiterType". Looks like TMW is finally deciding to uniformise
> passing options to all functions with this ersatz named parameter
> method. I wonder if this means they'll kill optimset and odeset.
>
> - Jordi G. H.
From reading the on-line docs, I think the examples below are proper behavior.
Do you agree?
strsplit ("road to hell", " ^", "delimitertype", "simple")
ans =
{
[1,1] = road
[1,2] = to
[1,3] = hell
}
strsplit ("road to hell", " ^", "delimitertype", "regexp")
ans =
{
[1,1] = road to hell
}
strsplit ("road to hell", "[ ^]", "delimitertype", "regexp")
ans =
{
[1,1] = road
[1,2] = to
[1,3] = hell
}
Ben
- strsplit needs an update, Jordi Gutiérrez Hermoso, 2013/03/27
- Re: strsplit needs an update, Ben Abbott, 2013/03/30
- Re: strsplit needs an update, Carnë Draug, 2013/03/31
- Re: strsplit needs an update, Ben Abbott, 2013/03/31
- Re: core, matlab, & OF name conflicts [Was: strsplit needs an update], Ben Abbott, 2013/03/31
- Re: core, matlab, & OF name conflicts [Was: strsplit needs an update], Richard Crozier, 2013/03/31
- Re: core, matlab, & OF name conflicts [Was: strsplit needs an update], Ben Abbott, 2013/03/31
- Re: core, matlab, & OF name conflicts [Was: strsplit needs an update], John W. Eaton, 2013/03/31
- Re: core, matlab, & OF name conflicts [Was: strsplit needs an update], Richard Crozier, 2013/03/31
- Re: core, matlab, & OF name conflicts [Was: strsplit needs an update], John W. Eaton, 2013/03/31