bugGNU Octave - Bugs: bug #34101, regexp 'match' problem with empty...

 
 

bug #34101: regexp 'match' problem with empty string

Submitter:  Mikael <mandolin>
Submitted:  Tue 23 Aug 2011 07:21:54 AM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.4.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 27 Oct 2011 04:16:46 PM UTC, comment #2: 

I believe I've fixed the problem with null patterns in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/c4b6ea833fa5). You will need to build from development sources or wait until the 3.6 release scheduled for December 2011 to see the change.

Rik <rik5>
Group administrator
Sat 03 Sep 2011 04:23:02 AM UTC, comment #1: 

There is something wrong with the handling of empty patterns in regexp.  I have not determined whether it is with Octave or with the PCRE libraries themselves.

Here is a simple test case which puts Octave into an infinite loop that one must use Ctrl-C to abort from.


regexprep ("hello world", "", "#")


Perl itself correctly matches a null pattern at every opportunity which means every single character as this command line example demonstrates.


perl -pe 's//#/g'
Hello World
#H#e#l#l#o# #W#o#r#l#d#



Rik <rik5>
Group administrator
Tue 23 Aug 2011 07:21:54 AM UTC, original submission:  

Hello.

I have read of some similar errors in "bug #33258: regexprep with empty replacement gives an error (not sure what cases)". It gives the same error message anyway "internal error calling pcre_exec; error code from pcre_exec is -24"

I'm not sure that if there is the same problem or a different one. In that case I'm sorry for spaming.

the code used is

string = 'this is a textstring with / to test to find it.';
stcomp = ['' '|' '/'];
regexp(string,stcomp,'match');

Mandolin


Mikael <mandolin>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mandolin (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-10-27 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2011-09-20 rik5 StatusNone Confirmed
    2011-09-03 rik5 Item GroupPerformance Segfault, Bus Error, etc.

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code