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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:52:42+00:00 2026-05-16T17:52:42+00:00

I need a regex pattern which will accommodate for the following. I get a

  • 0

I need a regex pattern which will accommodate for the following.

I get a response from a UDP server, it’s a very long string and each word is separated by \, for example:

\g79g97\g879o\wot87gord\player_0\name0\g6868o\g78og89\g79g79\player_1\name1\gyuvui\yivyil\player_2\name2\g7g87\g67og9o\v78v9i7

I need the strings after \player_n\, so in the above example I would need name0, name1 and name3,

I know this is the second regex question of the day but I have the book (Mastering Regular Expressions) on order! Thank you.

UPDATE. elusive’s regex pattern will suffice, and I can add the match(0) to a textbox. However, what if I want to add all the matches to the text box ?

textBox1.Text += match.Captures[0].ToString(); //this works fine.

How do I add “all” match.captures to the text box? :s sorry for being so lame, this Regex class is brand new to me .

  • 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-16T17:52:42+00:00Added an answer on May 16, 2026 at 5:52 pm

    i think that this test sample can help you

    string inp = @"\g79g97\g879o\wot87gord\player_0\name0\g6868o\g78og89\g79g79\player_1\name1\gyuvui\yivyil\player_2\name2\g7g87\g67og9o\v78v9i7";
    string rex = @"[\w]*[\\]player_[0-9]+[\\](?<name>[A-Za-z0-9]*)\b";
    Regex re = new Regex(rex);
    Match mat = re.Match(inp);
     for (Match m = re.Match(inp); m.Success; m = m.NextMatch())
    {
         Console.WriteLine(m.Groups["name"]);
    }
    

    you can take the name of the player from the m.Groups["name"]

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

Sidebar

Related Questions

I need a RegEx pattern which matches from where to the end of the
I need to retrieve a regex pattern matched strings from the given input. Lets
I am using the matches string builtin and need to run a regex pattern
I need help with a Regex expression to valid an ID pattern which is
I need a C# RegEx pattern which can remove anything between < and >
I need to alter a RegEx pattern. I currently have this which matches all
I need to write a regex which will match URLs that do not have
I need a C# Regex pattern to find telephone numbers in a string and
I need a Regex I think to see if a string is only a
i need a pattern which satisfies mysql field names, but also with the option

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.