Regex for IP address

后端 未结 6 1282
失恋的感觉
失恋的感觉 2020-11-28 14:59

I tried this code for validating IP address, but it doesn\'t work...

public static bool IP(string ipStr)
{
    string pattern = @\"^([1-9]|[1-9][0-9]|1[0-9][         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 15:07

    There is a previously answered question available for a valid IP address.

    As for debugging regular expressions, on Windows I heartily recommend Expresso. On the web, there is a free Flash-based tester available.

提交回复
热议问题