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

QRegularExpression:: wildcardToRegularExpression does not work as expected

    XMLWordPrintable

Details

    • All
    • 649ee12aba2ee92781f0ab888d21a1bdb440b7da (qt/qtbase/5.12)

    Description

      Wildcard matching does not work as expected

      *.p -> [^/]*\.p
      should be:
      [^/]*\.p$
      

      https://regex101.com/r/md7lXv/1

      When there is missing $ at end

      QString ext = "*.p"
      QString wildcard = QRegularExpression::wildcardToRegularExpression( ext );
      QRegularExpression re(wildcard);
      QRegularExpressionMatch match = re.match("file.pro"); <- it has match 
      

      Attachments

        For Gerrit Dashboard: QTBUG-72539
        # Subject Branch Project Status CR V

        Activity

          People

            sgaist Samuel Gaist
            fbucek fbucek
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes