Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Subdomain regex
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 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 Uri request = new Uri("http://subdomain.sub2.baseurl.com"); string host = request.Host; Regex regex = new Regex(@"(?<=\.|)\w+\.\w+$"); Match match = regex.Match(host); string hostWithoutPrefix = null; if (match.Success) hostWithoutPrefix = match.Groups[0].Value; Console.WriteLine(hostWithoutPrefix); } } }
run
|
edit
|
history
|
help
0
Chest Interaction Unity
Plt-D v.0.9.6 (Speed Vector)
Math 9.6
if else y var
Big numbers
30272 Example2
Plt-D v.0.9
useful
frgthyji8u7ytgfd
1