Question : Another Regex Question

Without using tring.Replace - just using the Regex.Match function, is it possible to take a line such as:

(3,'12','138','69','86',8090);

And extract out the numbers into the following format?

12.138.69.86:8090

Answer : Another Regex Question

Pui_Yun gave you insight into this in your last question. Continuing with his logic:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
static void Main(string[] args)
{
    string test = "(3,'12','138','69','86',8090)";
    string pattern = @"'(?<oct1>\d+)','(?<oct2>\d+)','(?<oct3>\d+)','(?<oct4>\d+)',(?<port>\d+)";
    string url = "##";

    if (Regex.IsMatch(test, pattern))
    {
        Match m = Regex.Match(test, pattern);

        url = string.Format("{0}.{1}.{2}.{3}:{4}", m.Result("${oct1}"), m.Result("${oct2}"), m.Result("${oct3}"), m.Result("${oct4}"), m.Result("${port}"));
    }

    Console.WriteLine(url);
    Console.ReadKey();
}
Random Solutions  
 
programming4us programming4us