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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:31:29+00:00 2026-06-03T05:31:29+00:00

Input : Hello my name is X . Blah Blah Blah EDIT 1: Any

  • 0

Input :

Hello my name is X. Blah Blah Blah

EDIT 1: Any user can enter his name substituted with X. So X is a variable with variable lenght.

Required Output :

Hello my name is Ahmed
Where X = Ahmed

Pattern :

(Hello my name is .+)\.

Really, this’s a newbie question 🙁 ,, I just start learning.
Not Working !

  • 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-03T05:31:30+00:00Added an answer on June 3, 2026 at 5:31 am

    I really have no clue what your pattern is attempting to accomplish, so I will start at the beginning. What you want to do is to match Hello my name is X. We can do that like so.

    /Hello my name is X\./
    

    But we don’t want to capture the letter X, we want to match what would be in X’s place. So now our regex becomes.

    /Hello my name is .+\./
    

    So the former regex now matches any character one or more times. Now we want to capture that and use it outside of the regex. We can do this with the capture, (), operator.

    /Hello my name is (.+)\./
    

    Now the question is, “How do we get the capture?” Well Regex.Match returns a Match. Now Match has a property called Groups which is a collection of all the captures from the regex. So our final, code is.

    var match = Regex.Match("Hello my name is dunsmoreb.", @"Hello my name is (.+)\.");
    Console.WriteLine(match.Groups[1]); // Prints `dunsmoreb`.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(document).ready(function(){ $('.submit').click(function(){ var value = $('#Name').attr('value'); alert(value); }); }); <input type=text value=10 id=Name/>Hello world
I have an input string that will follow the pattern /user/<id>?name=<name> , where <id>
array = [1,2,3,{:name => Peter}, hello] array.each do |element| # it can be inject,
Hello I have the next code into my website: <input type=text id=name name=name width=25px/>
I have something like this HTML structure : <form name=myvalue id=hello> <input type=text name=name
Hello friends following is my code HTML <ul> <li> <div class=input><input name= type=checkbox value=
string input = Hello World!; string pattern = (World|Universe); string replacement = $1; string
Hello folks, I've got the issue to add a browser event to some input
I have created button 2 below: <input id=Button1 type=button value=Stop onclick=alert('hello world');/> <input id=Button2
I got this code in my submit form <form id=myform action='hello.php' method='GET'> <input type=button

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.