Wed 16 Mar 2016 04:19:05 AM UTC, comment #5:
I checked ostrsplit and it produces the same results as when CollapseDelimiters is false. When run with that option set the other way it swallows the last term, which is different than strsplit.
I modified the patch because the '+' character is inside of a character class expression and doesn't need backslash escaping. The cset is here http://hg.savannah.gnu.org/hgweb/octave/rev/04e0598f8b94.
Marking as fixed and cloing report.
|
Mon 14 Mar 2016 01:29:33 AM UTC, original submission:
The following produces an error
instead of the correct result, which is
The problem seems to be that line 199 of 'strsplit.m'
doesn't escape '+' (it does escape other characters).
The solution is simply to add '\+' (escaped) to the regexp in that line, so that '+' also gets escaped:
I attach the modified file. It seems to work correctly, also with the 'CollapseDelimiters' option:
|