Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QRegExp: Match double-quoted text

    General and Desktop
    2
    4
    2983
    Loading More Posts
    • 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
      rapidcc last edited by

      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 Reply Quote 0
      • F
        fluca1978 last edited by

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

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

        1 Reply Last reply Reply Quote 0
        • R
          rapidcc last edited by

          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 Reply Quote 0
          • F
            fluca1978 last edited by

            [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 Reply Quote 0
            • First post
              Last post