Regular Expression C# Tutorial

using System;
using System.Text.RegularExpressions;
public class MainClass
{
    static void Main( string[] args ) {
        // Create regex to search for IP address pattern.
        string pattern = @"([01]?\d\d?|2[0-4]\d|25[0-5])\." +
                         @"([01]?\d\d?|2[0-4]\d|25[0-5])\." +
                         @"([01]?\d\d?|2[0-4]\d|25[0-5])";
        Regex regex = new Regex( pattern );
        Console.WriteLine( "Input given --> {0}",
                           regex.Replace("192.168.199.1",
                                         "xxx.xxx.xxx.xxx") );
    }
}
Input given -- xxx.xxx.xxx.xxx