title: Regexp matching separated proxy ip and port
body: <p>I am trying to scrape some proxy address from websites. I never learn regex in deep. There are a few common formats and here's the regex i am using</p>
  
  <pre><code>Regex ip = new Regex(@"(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\t*)(?: *)(?::*)(\d{2,5})");
  </code></pre>
  
  <p>Different website uses different format, could be 8.8.8.8\t\t 80, 8.8.8.8:80, 8.8.8.8  \t80</p>
  
  <p>This regex is able to capture most of the address but obviously it will mismatch 123.123.123.123 into ip 123.123.123.1 and port 23 if the ip address is not followed by port separated by one of the three elements</p>
  
  <p>I want the three common element \t,space,: to be zero or more but at least one of the three appears.</p>
  
  <p>I think of negative lookahead but I am too noob to make a good use.</p>
  
  <p>Any suggesion?</p>