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: Match double-quoted text
Forum Updated to NodeBB v4.3 + New Features

QRegExp: Match double-quoted text

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.2k 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.
  • R Offline
    R Offline
    rapidcc
    wrote on 12 Dec 2011, 14:47 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
    • F Offline
      F Offline
      fluca1978
      wrote on 12 Dec 2011, 15:06 last edited by
      #2

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

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

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rapidcc
        wrote on 12 Dec 2011, 15:10 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
        • F Offline
          F Offline
          fluca1978
          wrote on 12 Dec 2011, 15:35 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

          4/4

          12 Dec 2011, 15:35

          • Login

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