Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9270953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:29:52+00:00 2026-06-18T15:29:52+00:00

I have a string such as this… test_test_test:Hello \Hello\ Hello,Oh_yea_oh_yea,Hi there buddy I want

  • 0

I have a string such as this…

"test_test_test":"Hello \"Hello\" Hello","Oh_yea_oh_yea","Hi there buddy"

I want to grab

"test_test_test":"Hello \"Hello\" Hello"

So far my regex is this…

"test_test_test":

This would grab the key and colon. I will always know what "test_test_test" is, I just won’t know what the value is after the colon. It would be easy if I knew there wouldn’t be escaped quotations inside the quotations themselves, but there are. Thanks!

EDIT:

There can be commas inside, and there cannot be a quotation that’s not escaped inside.

My idea is something along the lines of…

"test_test_test":"[^(",)]*

In my head, this says keep going until you find the single quotation followed by a comma, (“,) then stop. However that doesn’t work above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:29:53+00:00Added an answer on June 18, 2026 at 3:29 pm

    This is the RAW regex. You may need to add more escape if you put into string or include a separator.

    "test_test_test":"(?:[^"\\]|\\[\\"])*"
    

    If you need flexible spacing:

    "test_test_test" *: *"(?:[^"\\]|\\[\\"])*"
    

    The key part is here: (?:[^"\\]|\\[\\"])*. It will match 0 or more of: non-quote-or-backslash, or escaped quote \" or escaped backslash \\.

    The regex above is still imprecise: the content in the quoted string is allowed to span multiple lines. Whether it is good or not depends on the grammar for the quoted string. However, multi-line quoted string in the languages I have seen usually doesn’t take the form described in my regex.

    The regex also treats the quoted string "\n" as invalid. You can easily modify the regex a bit to accommodate those cases, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string, such as this: $foo = 'Hello __(How are you) I
I have a string such as <html><body><div id=message>Hello World!</div></body></html> and I would like to
I have a string such as: #sometag-{serialized-data-here} And I want to match this pattern
I have such string: something: 20 kg/ something: 120 kg I have this regex
I have a std::string such as 20040531 , I want to format this as
I have a java string such as this: String string = I <strong>really</strong> want
I have a string such as: aabbccccdd I want to break this string into
Lets say a have a string such as this one: string txt = Lore
I have an xml string such as this: <s:Envelope xmlns:s=http://schemas.xmlsoap.org/soap/envelope/> <s:Body> <ExecuteResponse xmlns=http://schemas.microsoft.com/xrm/2011/Contracts/Services> <ExecuteResult
I have written this code to convert string in such format 0(532) 222 22

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.