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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:14:32+00:00 2026-06-09T18:14:32+00:00

I have a custom transport format that packages data up in the following format

  • 0

I have a custom transport format that packages data up in the following format

[a:000,”name”,”field”,”field”,”field”]

I’m trying to split the individual lines out to get the first character after the left bracket and all the CSV values.
a, 000, “name”, “field”, “field” etc…

I cobbled together

[^?,:\[\]]

This splits all the individual characters out not the colon/comma delimited fields.
I understand this won’t accommodate commas within quotes.So it’s clearly rubbish!

Embedded commas isn’t really a huge issue as we’re in control of the data at both ends so I could just escape them.

Thanks for any insight!

  • 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-09T18:14:34+00:00Added an answer on June 9, 2026 at 6:14 pm

    Instead of trying to split on multiple characters and ignore some of them, try to match whatever you want to match. Since you didn’t specify the implementation language I am posting this for Perl but you could apply it to any flavor which supports lookbehind and lookaheads.

    while ($subject =~ m/(\w+(?=:)|(?<=:)\d+|(?<=,")[^"]*?(?="))/g) {
        # matched text = $&
    }
    

    Explanation:

    # (\w+(?=:)|(?<=:)\d+|(?<=,")[^"]*?(?="))
    # 
    # Match the regular expression below and capture its match into backreference number 1 «(\w+(?=:)|(?<=:)\d+|(?<=,")[^"]*?(?="))»
    # Match either the regular expression below (attempting the next alternative only if this one fails) «\w+(?=:)»
    # Match a single character that is a “word character” (letters, digits, and underscores) «\w+»
    # Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
    # Assert that the regex below can be matched, starting at this position (positive lookahead) «(?=:)»
    # Match the character “:” literally «:»
    # Or match regular expression number 2 below (attempting the next alternative only if this one fails) «(?<=:)\d+»
    # Assert that the regex below can be matched, with the match ending at this position (positive lookbehind) «(?<=:)»
    # Match the character “:” literally «:»
    # Match a single digit 0..9 «\d+»
    # Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
    # Or match regular expression number 3 below (the entire group fails if this one fails to match) «(?<=,")[^"]*?(?=")»
    # Assert that the regex below can be matched, with the match ending at this position (positive lookbehind) «(?<=,")»
    # Match the characters “,"” literally «,"»
    # Match any character that is NOT a “"” «[^"]*?»
    # Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
    # Assert that the regex below can be matched, starting at this position (positive lookahead) «(?=")»
    # Match the character “"” literally «"»
    

    See it working.

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

Sidebar

Related Questions

I have custom classes that I currently instantiate within App.xaml as resources. I want
I have custom event that has several different subscribers who will all use the
I have custom gallery. Gallery represents items that are frame layout. There are one
I have custom component that I can place in my layout file (XML) for
I have a WCF solution that consists of the following class libraries: Exercise.Services: Contains
Suppose I have a custom file format, which can be analogous to N tables.
I have a mobile platform that I am trying to write some communications code
I have been following this tutorial in order to get username authentication with transport
I have a custom database that I exported as a CSV. I rearranged the
I have been trying to setup custom ajaxTransports for jQuery to short-circuit some workflows

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.