Skip to content

IP Address Validation

Jui Jaa

Asked Nov 22, 2005, 3:11 AM EST1 answer
Share
LinkedInX
C# I m new in this tech I have an input field for an IP Address. The input needs to be verified if it is a valid IP Address; thus I want to check this input character by character to make sure it only includes digits and dots; then I will check the each number between two dots is between 0 and 255.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Try this Regex expression:

    (((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?))

    Use this with the RegularExpressionValidatoror in code behind.
    0