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][
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.