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. [QRegExp] Parse a double string from the QString
Forum Updated to NodeBB v4.3 + New Features

[QRegExp] Parse a double string from the QString

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 898 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.
  • T Offline
    T Offline
    tzutalin
    wrote on last edited by
    #1

    Hello,
    Does someone know how to parse the 6844.823501 from the bellow string using QRegExp?

    QString str = " RenderThread-1171 ( 785) [002] ...1 6844.823501: tracing_mark_write: B|785|queue mFrameCallbackTask"

    Thanks in advance

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Saugglocke
      wrote on last edited by
      #2

      Hey,

      you could use an expression like this:

      @QString str = "RenderThread-1171 ( 785) [002] …1 6844.823501: tracing_mark_write: B|785|queue mFrameCallbackTask";
      QRegExp exp("[1-9]\.[0-9]");
      int i = exp.indexIn(str);
      if (i > 0)
      qDebug() << exp.cap();@

      Best regards

      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