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

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Won't Do
    • Affects Version/s: 5.14
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
      None
    • Platform/s:
      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

            Assignee:
            peppe Giuseppe D'Angelo
            Reporter:
            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