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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:13:01+00:00 2026-05-25T00:13:01+00:00

I need to do some pattern matching to process a list of questions and

  • 0

I need to do some pattern matching to process a list of questions and come up with
some statements that will head the list of solutions. Every question that I need to match
has a first sentence that ends in a “?”. For example if have the following string:

input="Which of the following can be aa ... zz?"

then I need to see if this matches some predefined patterns and if it does then I need to populate two variables. In this example the string above needs to result in the following:

string1= "Can be aa ... zz:"
string2= "Cannot be contained aa ... zz:"

Where the text aa … zzz in the source appears in the destination.

Inputs:

1 - Which of the following can be aa ... zz?
2 - Which of the following are correct?
3 - What will result when aa ... zz?
4 - Which of the following is a aa ... zz?
5 - Which are aa ... zz?
6 - What can be said about aa ... zz:
7 - Which of the following is true?
8 - What will be the result when aa ... zz?

Output 1:

1 - Can be aa ... zz:
2 - Correct:
3 - The following will result::
4 - A aa ... zz
5 - The following are aa ... zz
6 - True statement(s)
7 - True statement(s)
8 - The following will result:

Output 2:

1 - Cannot be aa ... zz:
2 - Incorrect:
3 - The following will not result
4 - Not a aa ... zz:
5 - Are not aa ... zz:
6 - False statement(s)
7 - False statement(s)
8 - The following will not result

I am thinking that I should store the input pattern and output patterns in a reference data class and then maybe some combination of link and pattern matching.

Does anyone have any suggestions. Even if I could see how to do one match that would be good.
If I have an example for one then I can code in more and work from that.

What kind of patterns? – The patterns are the text. So for example I am looking to see if my input string starts with “Which of the following can be” and ends with a “?”.

Where are these questions coming from? – A limited set of questions. If I cannot get a match then I will put in something like “True” or “False” in the outputs.

  • 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-25T00:13:02+00:00Added an answer on May 25, 2026 at 12:13 am

    It can be modeled something like below:

    static Tuple<string,string> Match(string question)
    {
       //Do the matching and return the string,string tuple where first 
       //string is for output 1 and second for output 2.
    }
    
    static Tuple<List<string>,List<string>> GetOutput(List<string> questions)
    {
        var r = questions.Select(q => Match(q));
        return new Tuple<List<string>,List<string>(r.Select(t => t.Item1).ToList(), r.Select(t =>  t.Item2).ToList());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a pattern that will traverse the document and get me all links
I need to open the my application from browser when some pattern matching url
I need some regular expression for .net that matches the following pattern : YYYYMM
I need some help with a simple pattern matching and replacement exercise I am
I need some advice on what kind of pattern(s) I should use for pushing/pulling
We need some input on what is a good design pattern on using AJAX
I need some help about RegExp in AS3. I have a simple pattern :
Isn't there a Design Pattern who describes how to high cohesion? I need some
Where to find good material to study observer pattern? I need some examples, of
Is it possible to use pattern matching over specified functions directly or with some

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.