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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:29:38+00:00 2026-05-28T00:29:38+00:00

Here are the types of strings I want to match (string are single quotes

  • 0

Here are the types of strings I want to match

(string are single quotes delimited (think var str = '"hi, what"s up, what a nice day"';)):

  1. ' "This is a str"'
  2. ' "This is also a str "
  3. '"So is this'
  4. '"This should "also match un"til th"e last "'

In each case it should capture whatever is after the first dquote if there’s only spaces before it up to a last quote (which is completely optional).

Another thing, a string containing just " shouldn’t match ex '""""""""""""' shouldn’t match at all.

Also leading and trailing whitespaces are ignored both between the quotes and outside the quotes.

Here’s the regex I have so far:

/^\s*\"\s*(.*?)\s*(?:\"\s*)?$

But it also gets '""""""""""""""""' so that’s where I’m stuck.

What can I do to not match a whole string of just dquotes?

EDIT:

I think I explained what I want wrong, I want it to match a string of dquotes but not capture any of it

  • 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-05-28T00:29:39+00:00Added an answer on May 28, 2026 at 12:29 am

    You can alter your regex so that the content contains at least one non-” character:

    /^\s*\"\s*(.*?[^"].*?)\s*(?:\"\s*)?$/
    

    Update: If you don’t want starting and trailing ” to be captured, just allow several of them at the borders:

    /^\s*\"+\s*(.*?)\s*(?:\"+\s*)?$/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In this text: warning here there are several types of warnings in this string
Here is my manifest file which shows error string types not allowed at android:configChanges
I have this following code, here CssClass is of the String type. <asp:Panel ID=Panel1
String[] a = c.toArray(new String[0]); First: Do I need type cast here? (I think
Here's the domain classes I'm working with: class Foo { String name, type static
I need to convert my string date to datetime type. Here's one date scenario:
I have some complex types here so I decided to use nifty trick to
Here is a list of blittable types . It contains Int32 and Int64. But
Here's my situation: I've got a number of specialized object types in my application,
Here is a C# program that tries Marshal.SizeOf on a few different types: using

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.