bugGNU Octave - Bugs: bug #41211, regexp: groups with '?' matching...

 
 

bug #41211: regexp: groups with '?' matching handled different between matlab and octave

Submitted by:  Michael C. Grant <mcgrant>
Submitted on:  Sun 12 Jan 2014 09:00:15 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: DuplicateAssigned to: None
Originator Name: Michael C. GrantOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 13 Jan 2014 03:09:29 AM UTC, comment #2:

I understand. As I said I have worked around it in my own code. I will simply assume that it needs to stay that way.

Michael C. Grant <mcgrant>
Sun 12 Jan 2014 10:14:29 PM UTC, comment #1:

This is a duplicate of bug #38149. See the discussion there for more information. I've done just about all of the work with Octave's regexp code for the last two releases, and unfortunately there are some incompatibilities that are not easy to fix without a full re-write/overhaul of the code. It is way more than I want to take on as a volunteer, although if we got it crowdfunded or there was a paying client it might be possible.

Rik <rik5>
Project Administrator
Sun 12 Jan 2014 09:00:15 PM UTC, original submission:

If a grouping construct is followed by '?', and that group is not matched, Octave does not return an entry for that token. MATLAB, however, returns an empty string.

At first I thought this is probably not important, and I've already fixed it in my code. Indeed, MATLAB's behavior might be considered wrong, since the empty string will in many cases not be a valid match.

But here's an example where I think the Octave behavior could be potentially problematic. In this case, the final grouping is returned as token #2 in Octave, and token #3 in MATLAB. It seems to me that MATLAB's behavior is better here. After all, is that second token returned by Octave from group 2 or group 3? To determine this, you would have to do additional tests.

Octave:

Matlab:

Michael C. Grant <mcgrant>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mcgrant (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 22 Dec 2015 04:30:16 PM UTCmtmillerOpen/ClosedOpen=>Closed
    Mon 13 Jan 2014 12:54:19 AM UTCrik5StatusNone=>Duplicate
    Sun 12 Jan 2014 10:14:29 PM UTCrik5Dependencies-=>Depends on bugs #38149

    Back to the top


    Powered by Savane 3.1-cleanup1