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

QRegularExpressionMatch should provide better access to named capture groups

    XMLWordPrintable

Details

    Description

      Regex pattern: ^test(?<first>\w+)test$
      Sample string: testsomethingtest

      I can ask for capture 1 or named capture "first" to get "something" as my answer.

      What I cannot do is ask for a key/value map of capture groups when I don't know that "first" is the name of the group, as is the case with user-supplied (run-time) patterns.

      Instead of (or in addition to) capturedTexts() returning a simple string list, can we have a method of retrieving all captured texts and the number and/or name that goes with each?

      Attachments

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

        Activity

          People

            peppe Giuseppe D'Angelo
            jkdoug Jason Douglas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes