title: c# find certain strings of an array
body: <p>I am making a proxy scraper program and i need to find the proxies in an array</p>
  
  <p>Here is an example of what i want to get out of this line:</p>
  
  <p><code>document.write('77.237.138.51')</code></p>
  
  <p>I want to remove <code>document.write('" and "')</code> so it only shows the proxy</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>client.DownloadFile("http://www.gatherproxy.com/sockslist", "source.txt"); 
  string [] lines = File.ReadAllLines("source.txt");
  string start = "document.write('";
  string end = "')";
  </code></pre>
  
  <p>Now how would I make it so where i can delete start and end and return the middle element (the proxy)</p>
  
  <p>In reply to Domysee</p>
  
  <pre><code>using (WebClient client = new WebClient())
              client.DownloadFile("http://www.gatherproxy.com/sockslist", "source.txt");
              string[] lines = File.ReadAllLines("source.txt");
          for (int i = 0; i &lt; 1000; i++)
          {
              string[] ipAddresses = lines.Select(l =&gt; Regex.Match(l, @"(\d+\.){3}\d+").Value).ToArray();
              i++;
              string[] port = lines.Select(l =&gt; Regex.Match(l, @"(\d+\.){3}\d+").Value).ToArray();
              Console.WriteLine(ipAddresses + ":" + port);
          }
              Console.ReadLine();
  </code></pre>