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

  • Home
  • SEARCH
  • 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 887351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:12:57+00:00 2026-05-15T13:12:57+00:00

I got quite a lot of strings (segments of SQL code, actually) with the

  • 0

I got quite a lot of strings (segments of SQL code, actually) with the following format:

('ABCDEFG', 123542, 'XYZ 99,9')

and i need to split this string, using C#, in order to get:

  • ‘ABCDEFG’
  • 123542
  • ‘XYZ 99,9’

I was originally using a simple Split(','), but since that comma inside the last parameter is causing havoc in the output i need to use Regex to get it. The problem is that i’m still quite noobish in regular expressions and i can’t seem to crack the pattern mainly because inside that string both numerical and alpha-numerical parameters may exist at any time…

What could i use to split that string according to every comma outside the quotes?
Cheers

  • 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-15T13:12:57+00:00Added an answer on May 15, 2026 at 1:12 pm

    You could split on all commas, that do have an even number of quotes following them , using the following Regex to find them:

    ",(?=(?:[^']*'[^']*')*[^']*$)"
    

    You’d use it like

    var result = Regex.Split(samplestring, ",(?=(?:[^']*'[^']*')*[^']*$)");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got quite a bit of PHP code laying around and am wondering at
I've got a ComboBox in WPF that I've mucked around with quite a lot
I've got quite a few GreaseMonkey scripts that I wrote at my work which
My company has got quite a number of client laptops out in the field.
I'm quite confused by something. I've got 2 select lists, and if you choose
It's quite a simple question - how do I sort a collection? I've got
We got strange error last days. ___doPostBack is undefined. We are building quite advanced
I've got a simple calendar displaying some events, that's not quite giving me the
On my local git repo I've got many commits, which include 'secret' connection strings
Sorry or the confusing title! It's actually a lot simpler than it sounds. I've

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.