Cluj München 1140km

Gânduri clujene din Bavaria

München - Munich - Monaco di Baviera

19. ianuarie 2009 13:36
by skorpionking
0 Comentarii

.NET 60 seconds code: regular expression for IP addresses in C#

19. ianuarie 2009 13:36 by skorpionking | 0 Comentarii

Here is a reg exp matching IP addresses in C#:

                   Regex regIP = new Regex(
                    @"(?<First>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Second>2[0-4]\d|25"
                    + @"[0-5]|[01]?\d\d?)\.(?<Third>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?"
                    + @"<Fourth>2[0-4]\d|25[0-5]|[01]?\d\d?)",
                    RegexOptions.IgnoreCase
                    | RegexOptions.CultureInvariant
                    | RegexOptions.IgnorePatternWhitespace
                    | RegexOptions.Compiled
                    );

Adaugă comentariu

biuquote
Loading