Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved]QRegExp doesn't support lookbehind assertions?
Qt 6.11 is out! See what's new in the release blog

[solved]QRegExp doesn't support lookbehind assertions?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chenjie4255
    wrote on last edited by
    #1

    hello guys, Now I try to use QRegexp with the lookbehind synax "(?<=)", but i find it doesn't work, my code is as below.

    @
    QString test = "HELLO CHEN";
    QRegExp reg("(?<=HELLO\s)[A-Za-z]*");
    qDebug()<<reg.isValid(); //!< just output false;
    @

    and, I fount a bug report in https://bugreports.qt-project.org/browse/QTBUG-2371.However,this bug has been closed, this page show that this bug will be fixed in version 5.0.0 .Now i run those code on 5.1.0, this bug is still there. Is it my own problem?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The bug reports says that it's implemented in QRegularExpression, did you try that class ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chenjie4255
        wrote on last edited by
        #3

        thanks, it work:)
        [quote author="SGaist" date="1379281259"]Hi,

        The bug reports says that it's implemented in QRegularExpression, did you try that class ?[/quote]

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved