bugGNU Octave - Bugs: bug #48377, regex cannot process nested token...

 
 

bug #48377: regex cannot process nested token groups

Submitted by:  Lachlan Andrew <lachlan>
Submitted on:  Sat 02 Jul 2016 12:17:26 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 02 Jul 2016 12:42:39 PM UTC, comment #1:

Oops. I just didn't know how to use regular expressions.

The pattern was cut off, but was originally (...(...))+ and the "correct" behaviour of that regex is to return only the last match of the pattern.

Lachlan Andrew <lachlan>
Project Member
Sat 02 Jul 2016 12:17:26 PM UTC, original submission:

I would expect

to give four values in T: " abc", "abc", " def", "def". However, it only gives two: " def", "def":

I haven't checked whether Matlab handles nested groups, but if this pattern isn't handled correctly, it should report an error, rather than giving the wrong result.

Lachlan Andrew <lachlan>
Project Member

 

(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 lachlan (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 02 Jul 2016 12:42:39 PM UTClachlanStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1