title: Extracting double value from a string c#
body: <p>I want to extract the double from my string.</p>
  
  <pre><code>buff = "VA VV_CELL1 3.55"
  </code></pre>
  
  <p>When i use the following code </p>
  
  <pre><code>private void GetLine(string msg, string buff, double numb)
  {
      comPort.WriteLine(msg); 
      Thread.Sleep(50);
      buff = comPort.ReadExisting();
      Thread.Sleep(50);
      MatchCollection matches = Regex.Matches(buff, @".*?([-]{0,1} *\d+.\d+)");
      List&lt;double&gt; doubles = new List&lt;double&gt;();
      foreach (Match match in matches)
      {
          string value = match.Groups[1].Value;
          value = value.Replace(" ", "");
          doubles.Add(double.Parse(value));
          Thread.Sleep(200);
          numb = doubles[0];                
      } 
  }
  </code></pre>
  
  <p>This code work for my other strings but "CELL1" contains a number so i dont get the wanted value "3.55" any ideas?</p>