bugGNU Octave - Bugs: bug #44641, strsplit fails to split with a...

 
 

bug #44641: strsplit fails to split with a delimiter of '<' or '>'

Submitted by:  None
Submitted on:  Fri 27 Mar 2015 03:28:26 AM UTC  
 
Category: Octave FunctionSeverity: 5 - Blocker
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Richard LobbOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.1
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 29 Mar 2015 04:56:01 AM UTC, comment #4:

Thanks for the super-quick fix, guys.

Richard

Anonymous
Sun 29 Mar 2015 02:39:30 AM UTC, comment #3:

I overhauled the function in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/7569e880d56c). Along the way I also fixed this bug. It will be a part of the 4.0 release.

Rik <rik5>
Project Administrator
Fri 27 Mar 2015 05:16:35 PM UTC, comment #2:

The intent of the code is to escape anything that might look like a special character to a regular expression. The code currently takes anything which is not a work character and escapes it which works great for '?' which is escaped to '\?'. Unfortunately, '\>' and '\<' are actual regular expressions themselves which mean end-of-word and beginning-of-word. Need to take a look at the PCRE reference manual and determine if there are any other such special expressions preceded by a slash and add them to line 191 in strsplit.m.

Rik <rik5>
Project Administrator
Fri 27 Mar 2015 08:34:42 AM UTC, comment #1:

The problem is with line 191 in strsplit.m

which changes '>' to '\>'

Avinoam Kalma <avinoam>
Project Member
Fri 27 Mar 2015 03:28:26 AM UTC, original submission:

strsplit cannot split a string using a separator of '<' or '>'.

Here's the console output from a simple failing test:

Compare that with the output with Octave, V3.6.4, which produces the correct output:

or using Matlab R2013b and R2014b:

'>' also fails but all other separators (at least those with ordinal values between 32 and 126 inclusive) are fine. The output from the following script:

is

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by avinoam (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 29 Mar 2015 02:39:30 AM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Fri 27 Mar 2015 01:46:03 PM UTCjweSeverity3 - Normal=>5 - Blocker
      Item GroupIncorrect Result=>Regression

    Back to the top


    Powered by Savane 3.1-cleanup1