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

QRegularExpression: add docs note about how "-" in [] is treated differently than with QRegExp

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.14
    • Core: Other
    • None
    • All

    Description

      With QRegExp patterns like [\w-9] were valid, IIUC, there weren't treated as a range of characters and QRegExp didn't complain about it.

      But with QRegularExpression such a pattern is invalid; so with QRegularExpression:

      • To match a literal "-" in [] it has to be right after [, escaped or right before ]
      • To match a range of characters, it has be used correctly, and QRegularExpression isn't as forgiving as QRegExp is

      I suggest adding a porting note to the docs about this issue. (And sorry if I got anything wrong up there ).

      Thanks in advance.

      Attachments

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

        Activity

          People

            peppe Giuseppe D'Angelo
            ahmad.samir Ahmad Samir
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes