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

QRegExp length of matched group

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • P5: Not important
    • None
    • 5.0.1
    • None
    • Mac OS 10.8.3

    Description

      Currently it is possible to tell the staring position of a QRegExp match group:

      rx.pos(nth);

      and the only way to find out the length of the captured text is to:

      rx.cap(nth).length();

      If I understand it correctly, this copies the captured characters to create a QString which is immediately thrown away after calling length().

      I have not done any performance measurements but perhaps it would be useful to expose the length of match directly:

      rx.len(int nth);

      or to expose the end of the matched text group:

      rx.end(int nth);

      Attachments

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

        Activity

          People

            Eddy Edward Welbourne
            ecir.hana Ecir Hana
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes