Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72162

QString::replace fails with QRegExp and QRegularExpression

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.11.2
    • None
    • Linux/X11

    Description

      QString str("/");
      qDebug() << str.replace(QRegularExpression("/?$"), "/test");

      This outputs /test/test. To reproduce, run the attached test program.

      Python:

      >>> print(re.sub('/?$', '/test', '/'));
      /test

      Sed:

      $ echo "/" | sed 's#/?$#/test#'
      /test
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            peppe Giuseppe D'Angelo
            t-om Topi Mäenpää
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes