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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:31:31+00:00 2026-05-23T12:31:31+00:00

C# Regex Split – commas outside quotes var result = Regex.Split(samplestring, ,(?=(?:[^\]*\[^\]*’)*[^\]*$)); I have

  • 0

C# Regex Split – commas outside quotes

var result = Regex.Split(samplestring, ",(?=(?:[^\"]*\"[^\"]*')*[^\"]*$)");

I have problems to understand how it works.

Specifically, I don’t know what the * matches here?

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

Does it mean

there are 0 or more of (?=(?:[^\"]*\"[^\"]*')

update for a sample input

2,1016,7/31/2008 14:22,Geoff Dalgas,6/5/2011 22:21,http://stackoverflow.com,"Corvallis, OR",7679,351,81,b437f461b3fd27387c5d8ab47a293d35,34

Use the following code to test:

string samplestring = "2,1016,7/31/2008 14:22,Geoff Dalgas,6/5/2011 22:21,http://stackoverflow.com,\"Corvallis, OR\",7679,351,81,b437f461b3fd27387c5d8ab47a293d35,34";
  • 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-23T12:31:31+00:00Added an answer on May 23, 2026 at 12:31 pm

    It means that the group (?:[^']*'[^']*') is matched zero or more times.

    ,       // match one comma
    (?=     // Start a positive lookAHEAD assertion
    (?:     // Start a non-capturing group
    [^']*   // Match everything but a single-quote zero or more times
    '       // Match one single-quote
    [^']*   // Match everything but a single-quote zero or more times
    '       // Match one single-quote
    )*      // End group and match it zero or more times
    [^']*   // Match everything but a single-quote zero or more times
    $)      // end lookAHEAD
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string: [\n['-','some text what\rcontains\nnewlines'],\n\n trying to parse: Regex.Split(@[\n['-','some text what contains
I have tried this... Dim myMatches As String() = System.Text.RegularExpressions.Regex.Split(postRow.Item(Post), \b\#\b) But it is
I have a regex expression that I'm doing a split against another string and
Let's say we have a string: somethinghere%C3somethinghere%83%C3%A8%C3%AF%C3%AD%C3%AEsomethinghere%C3%A7somethinghere What would be the Regex.Split pattern to
string input = @12.2.2010|7; string pattern = @|; foreach (string result in Regex.Split(input, pattern))
I have created a function to implement the regex.split in sql. Here's the code:
I have this code Dim parts As New List(Of String)(Regex.Split(RichTextBox2.Text, ~\d)) That splits lines
i search for a regex to split the following string: aaa[bbb,ccc[ddd,{eee:1,mmm:999}],nnn[0,3]] aaa[bbb,ccc[ddd,{eee:1, mmm:[123,555]}],nnn[0,3]] aaa[bbb,
What regex pattern would need I to pass to java.lang.String.split() to split a String
How can I split by word boundary in a regex engine that doesn't support

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.