Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Map usernames from domain\username format to username@domain.com format
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here var matcher = new Regex(@"([^\\]+)\\(.+)$"); var username = @"exprosoft\dag_evry"; var result = matcher.Match(username); Console.WriteLine("Captures:"); foreach(var match in result.Captures){ Console.WriteLine(match); } Console.WriteLine(); Console.WriteLine("Groups:"); foreach(var match in result.Groups){ Console.WriteLine(match); } Console.WriteLine(); Console.WriteLine("Mapped result:"); Console.WriteLine(string.Format("{0}@{1}.com", result.Groups[2], result.Groups[1])); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Lotto unieke getallen
Frase
FlagsAttributes - Usage example
Anonoymus method using delegate in C#
VBA
Fórum ➡ GroupJoin'ing Books and Orders ♦
IMT
C# interview question. Closure pitfalls.
How To Get Discord Nitro For Free
sss0
Please log in to post a comment.