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. How to match whitespaces in regex search
QtWS25 Last Chance

How to match whitespaces in regex search

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 144 Views
  • 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.
  • M Offline
    M Offline
    mravenca
    wrote on last edited by
    #1

    Hello,
    I am trying to search for a block of text that begins with "/*something".
    How can I match this with regex in Qt Creator?
    Thanks
    Vaclav

    jsulmJ JonBJ 2 Replies Last reply
    0
    • M mravenca

      Hello,
      I am trying to search for a block of text that begins with "/*something".
      How can I match this with regex in Qt Creator?
      Thanks
      Vaclav

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @mravenca In the title you want to match whitespaces, in the description you want to match /*something - so, what do you really want to match?

      \s matches whitespaces.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • M mravenca

        Hello,
        I am trying to search for a block of text that begins with "/*something".
        How can I match this with regex in Qt Creator?
        Thanks
        Vaclav

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @mravenca said in How to match whitespaces in regex search:

        begins with "/*something".

        ^/\*something

        or maybe

        ^\s*/\*\s*something

        If you don't care about regular expression you could switch that off and just search for /*something :)

        1 Reply Last reply
        1

        • Login

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