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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:34:56+00:00 2026-05-11T21:34:56+00:00

This is supposedly a very easy question, but I just can’t seem to find

  • 0

This is supposedly a very easy question, but I just can’t seem to find the right solution. There is a string in the format:

A:B=C;D:E=F;G:E=H;...

whereas A, B and C are alphanumeric (and may be lower as well as upper case). A and B are of length 1+, C may be empty.

I figured I’d have to use something along the lines of

((?<A>.+):(?<B>.+)=(?<C>.*);)*

but I don’t see how to make it match in a lazy way. I’m also not sure how to obtain the results of the respective matches so I’d appreciate a little code sample.

I’d be glad if you could give me a hint.

  • 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-11T21:34:56+00:00Added an answer on May 11, 2026 at 9:34 pm

    You might use \w to match alphanumeric characters rather than ., which matches everything. Then, you might try to capture one match at a time:

    (?<A>\w+):(?<B>\w+)=(?<C>\w*);
    

    Here’s a small example:

    Regex regex = new Regex("(?<A>\\w+):(?<B>\\w+)=(?<C>\\w*);");
    string test = "A:B=C;D:E=F;G:E=H";
    
    // get all matches
    MatchCollection mc = regex.Matches(test);
    
    foreach (Match m in mc) { 
        Console.WriteLine("A = {0}", m.Groups["A"].Value);
        Console.WriteLine("B = {0}", m.Groups["B"].Value);
        Console.WriteLine("C = {0}", m.Groups["C"].Value);
    }
    

    note: there are several tools that allow you to experiment with regular expressions and also provide some sort of help; I personally like Expresso – try it out, it will be very useful for learning.

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

Sidebar

Related Questions

I can't seem to find solutions to this supposedly simple problem /bug, so here
This is probably a very stupid question, but I am just not sure which
I'm VERY new to Java, so I'm hoping this is an easy question. I'm
I have a very simple and easy question, but I do not know how
I am hesitated to ask this question because it looks weird. But anyway. Just
This supposedly easy task gave me some headache. I simply want to let the
Solution: Just to add the solution: sectionGroups do not seem to have attributes. The
Here is an easy one, but can't figure out why is not working. Need
Maybe it's just the way my mind works, but I have a very hard
This is a question I was wondering about for some time now, but couldn't

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.