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 8321355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:59:16+00:00 2026-06-08T22:59:16+00:00

I am writing to extract strings which are surrounded by quotes (). I use

  • 0

I am writing to extract strings which are surrounded by quotes (“). I use the below statement in jquery to get it.

var item = objstr.match(/\"(([^\"])*)\"/g);

But i want to make an exception for \” to be allowed.

  • 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-08T22:59:17+00:00Added an answer on June 8, 2026 at 10:59 pm

    This regex might work as well, without using look-aheads or look-behinds: (remove the spaces!)

    /" (\\\\ | \\" | [^"])* "/
    

    Read: Match a string from double-quote to double quote. In between there may be nothing or any combination of escaped backslashes \\, escaped double quotes \" or any non-quote characters. This allows for input like

    "abc\\abc\abc\"abc\\\"abc"
    

    to be valid, but not

    "abc\\"abc"
    //    ^ String terminates here
    

    You might want that if your string may have the unescaped meaning \".

    The answer from @nickb doesn’t have this feature/bug, whatever you call it. Both strings are valid in his regex.

    Should your regex engine be able to turn off backtracking, this is the time to use it. In Perl, I have to add a + to a quantifier (or turn to esoteric branch resets). I don’t know what you need.

    /" (\\\\ | \\" | [^"])*+ "/
    

    We also want greedy behaviour, so no *? constructs.

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

Sidebar

Related Questions

I am writing a crawler in Perl, which has to extract contents of web
I'm writing a python script to extract data out of our 2GB Apache access
I am writing a function to extract decimals from a number. Ignore the exception
Aside from writing custom code are there any existing features in .NET which allows
I'm writing a script where I extract command line arguments using getopt, qualify the
I'm writing this small program to extract any number of email address from a
I'm writing some quick code to try and extract data from an mp3 file
I'm writing a method that resets a logging system. I need to get an
I'm writing a user-defined function to extract values from an XML column in SQL
I'm writing a Java program where I have to extract some data from a

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.