Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QRegExp: Match double-quoted text
Qt 6.12 LTS is out! See what's new in the release blog

QRegExp: Match double-quoted text

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

    Hello guys,

    I want to match some quoted text like this "asdfhl"
    I tried many Regex Strings but something like "[^"']*" just gives me two quotes, without any text or space between.

    Any ideas? I recently asked on IRC but nobody seemed to be able to help me. Thanks in advance.

    kind regards,
    rapidcc

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Probably you need this (at least it works on Perl):

      @"([^"']*)"@

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Thank you very much for this quick reply!

        I'm a bit confused because I had used this very regex earlier and it didnt work. However, it works perfectly now.

        kind regards,
        rapidcc

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          [quote author="rapidcc" date="1323702626"]
          I'm a bit confused because I had used this very regex earlier and it didnt work. However, it works perfectly now.
          [/quote]

          Please consider that there are slightly differences between regexp engine implementations. That is why most of such implementation are becoming more and more perl-compatible.
          In your particular case there was a problem with the atom, that was not indicated.

          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
          • Unsolved