title: Extract string from a file to another
body: <p>Hoping to extract these lines of Polyline object, but excluding those ones with the generic name (Polyline)</p>
  
  <pre><code>     &lt;/polyline_object&gt;&lt;polyline_object name="ECC018" kind="PolyLineObjectX"&gt;&lt;name&gt;ECC018&lt;/name&gt;&lt;point length="3"&gt; -312.52499389648435 62.385520935058598 39.511650085449216 &lt;/point&gt;&lt;point length="3"&gt; -309.38851928710938 62.611492156982426 39.349102020263674 &lt;/point&gt;
       &lt;/polyline_object&gt;&lt;polyline_object name="STEP (25)" kind="PolyLineObjectX"&gt;&lt;name&gt;STEP (25)&lt;/name&gt;&lt;point length="3"&gt; -313.64254760742189 62.275627136230464 39.640590667724608 &lt;/point&gt;&lt;point length="3"&gt; -312.55957031249997 62.376560211181645 39.627662658691405 &lt;/point&gt;&lt;point length="3"&gt; -312.7188415527344 64.059944152832026 39.638328552246093 &lt;/point&gt;&lt;point length="3"&gt; -313.1711730957031 64.028800964355469 39.651771545410157 &lt;/point&gt;
       &lt;/polyline_object&gt;&lt;polyline_object name="Polyline000 (3)" kind="PolyLineObjectX"&gt;&lt;name&gt;Polyline000 (3)&lt;/name&gt;&lt;point length="3"&gt; 2.6950883865356445 44.503276824951174 37.697837829589843 &lt;/point&gt;&lt;point length="3"&gt; -75.466423034667968 47.88733673095703 39.203029632568358 &lt;/point&gt;&lt;point length="3"&gt; -111.57073211669922 43.517368316650394 39.25448226928711 &lt;/point&gt;&lt;point length="3"&gt; -118.22566986083984 37.122959136962893 39.077449798583987 &lt;/point&gt;&lt;point length="3"&gt; -122.02384185791014 27.188623428344726 38.753135681152346 &lt;/point&gt;&lt;point length="3"&gt; -121.8035888671875 22.215513229370118 38.595668792724608 &lt;/point&gt;&lt;point length="3"&gt; -120.69635772705078 10.44062900543213 38.525798797607424 &lt;/point&gt;&lt;point length="3"&gt; -119.39793395996093 -1.391708493232727 38.479351043701171 &lt;/point&gt;&lt;point length="3"&gt; -111.05265045166016 -0.50858658552169798 38.464771270751955 &lt;/point&gt;&lt;point length="3"&gt; -109.4428482055664 -13.537007331848144 38.171108245849606 &lt;/point&gt;
       &lt;/polyline_object&gt;&lt;polyline_object name="Polyline001 (3)" kind="PolyLineObjectX"&gt;&lt;name&gt;Polyline001 (3)&lt;/name&gt;&lt;point length="3"&gt; -129.52786254882813 166.05583190917968 40.779067993164064 &lt;/point&gt;&lt;point length="3"&gt; -125.67138671875 156.94186401367187 40.774162292480467 &lt;/point&gt;&lt;point length="3"&gt; -113.06429290771485 116.86449432373046 40.768569946289062 &lt;/point&gt;&lt;point length="3"&gt; -113.13454437255859 116.2726516723633 38.973728179931642 &lt;/point&gt;&lt;point length="3"&gt; -112.24276733398437 113.77603149414062 38.96575927734375 &lt;/point&gt;&lt;point length="3"&gt; -111.49858856201173 114.01608276367187 38.981853485107424 &lt;/point&gt;&lt;point length="3"&gt; -106.42765045166016 100.83160400390626 39.037631988525389 &lt;/point&gt;&lt;point length="3"&gt; -107.75248718261718 99.620536804199219 38.996852874755859 &lt;/point&gt;&lt;point length="3"&gt; -103.67796325683594 86.614151000976563 39.067848205566406 &lt;/point&gt;&lt;point length="3"&gt; -116.04350280761718 74.861045837402342 39.25809097290039 &lt;/point&gt;&lt;point length="3"&gt; -122.38642120361328 74.47401428222656 39.252414703369139 &lt;/point&gt;&lt;point length="3"&gt; -122.78543853759765 74.44397735595703 39.25035858154297 &lt;/point&gt;&lt;point length="3"&gt; -122.8647918701172 73.826538085937498 42.272285461425779 &lt;/point&gt;&lt;point length="3"&gt; -119.59778594970704 41.25065612792969 42.267509460449216 &lt;/point&gt;&lt;point length="3"&gt; -175.69285583496093 35.908145904541018 42.259567260742189 &lt;/point&gt;&lt;point length="3"&gt; -188.11454772949219 63.682300567626957 42.2263069152832 &lt;/point&gt;&lt;point length="3"&gt; -218.66964721679686 60.854137420654298 42.268066406249997 &lt;/point&gt;&lt;point length="3"&gt; -221.23516845703126 88.376388549804685 41.072391510009766 &lt;/point&gt;&lt;point length="3"&gt; -225.47735595703126 88.032569885253901 41.053840637207034 &lt;/point&gt;&lt;point length="3"&gt; -229.76127624511718 131.20693969726563 40.885227203369139 &lt;/point&gt;&lt;point length="3"&gt; -187.65846252441405 152.36131286621094 40.93291473388672 &lt;/point&gt;&lt;point length="3"&gt; -180.48707580566406 149.78179931640624 40.9343147277832 &lt;/point&gt;&lt;point length="3"&gt; -129.52786254882813 166.05583190917968 40.779067993164064 &lt;/point&gt;
       &lt;/polyline_object&gt;&lt;polyline_object name="Polyline002 (3)" kind="PolyLineObjectX"&gt;&lt;name&gt;Polyline002 (3)&lt;/name&gt;&lt;point length="3"&gt; -112.50492858886718 115.78641510009766 38.953884124755859 &lt;/point&gt;&lt;point length="3"&gt; -111.31856536865234 112.05601501464843 38.973159790039066 &lt;/point&gt;
  </code></pre>
  
  <p>I've used this</p>
  
  <pre><code>        MatchCollection m2 = Regex.Matches(html, "polyline_object name=\"*(.+?)\"", RegexOptions.Singleline);
  </code></pre>
  
  <p>but it gives me all of the names of above lines.</p>
  
  <p>Apologize if I am not being clear, its my first time posting a question here. Thanks a lot!</p>
  
  <p>These are the codes I am using which gives out both generic and the one I wanted.
           MatchCollection m2 = Regex.Matches(html, "polyline_object name=\"*(.+?)\"", RegexOptions.Singleline);</p>
  
  <pre><code>     foreach (Match m in m2){
                  if (m.Groups[1].Value != "Polyline(.+?)"){
                      string line = m.Groups[1].Value;
                      drawlines.Add(line);
                  }
              }
  </code></pre>