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] Need help with regular expression
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Need help with regular expression

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.7k 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.
  • A Offline
    A Offline
    AcerExtensa
    wrote on last edited by
    #1

    Hello everybody!
    Can somebody please help me with regular expression for QRegExp? I just hate them :(

    I need to get from strings simple numeric strings:
    7.5.5468 dev -> 755468
    7.5.5468 pre -> 755468
    7.6 -> 76
    7.6 pre -> 76
    7.7 beta1 -> 77 (without 1 on the end)

    Thank you in advance!

    God is Real unless explicitly declared as Integer.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Do you mind posting your solution here, so that others could benefit from it too? Thanks!

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AcerExtensa
        wrote on last edited by
        #3

        have done this without regexp.

        @
        long chk_version(QString ver)
        {
        return ver.contains(' ')?ver.left(ver.indexOf(' ')).remove('.').toLong():ver.remove('.').toLong();
        }
        @

        God is Real unless explicitly declared as Integer.

        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