bugGNU Octave - Bugs: bug #35910, Incorrect regex matching of...


bug #35910: Incorrect regex matching of multi-byte UTF-8 characters

Submitted by:  Burkart Lingner <burkart>
Submitted on:  Tue 20 Mar 2012 04:29:25 PM UTC  
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: In ProgressAssigned to: Rik <rik5>
Originator Name: Open/Closed: Open
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.


Sat 19 Nov 2016 09:08:45 PM UTC, comment #3:

This issue is still present in Octave 4.2.0.

Hartmut <hardy>
Thu 04 Jun 2015 01:35:26 AM UTC, comment #2:

Updating status to the development release, still present.

Mike Miller <mtmiller>
Project Administrator
Sun 25 Mar 2012 08:30:49 PM UTC, comment #1:

Confirmed on a recent tip.

Currently Octave does not support UTF8 in regular expressions, although it is not hard to add. I've made an experimental patch that does so but it does impact performance. UTF8 is 23% slower than non-UTF8 pattern matching.

Adding support for UTF8 is a big enough change that I am going to take the issue to the Octave Maintainers mailing list so that we can make a decision about how best to implement this. It is also big enough that this will come out not as a bug fix, but in the next major release of Octave (3.8.0).

Rik <rik5>
Project AdministratorIn charge of this item.
Tue 20 Mar 2012 04:29:25 PM UTC, original submission:

When matching a single character at a position where there's a multi-byte UTF-8 character, only the first byte is matched. Depending on how this match is then processed, it can result in invalid UTF-8. Example:


where "?" is the replacement character and the UTF-8 codes for "§", ";", and "x" are "0xC2 0xA7", "0x3B", and "0x78", respectively.

The expected output would have been

Burkart Lingner <burkart>


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

Attach File(s):

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 hardy (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by burkart (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 04 Jun 2015 01:35:26 AM UTCmtmillerRelease3.6.1=>dev
      Operating SystemGNU/Linux=>Any
    Sun 25 Mar 2012 08:30:49 PM UTCrik5CategoryInterpreter=>Libraries
      StatusNone=>In Progress
      Assigned toNone=>rik5

    Back to the top

    Powered by Savane 3.1-cleanup1