title: Extracting double/decimal number from string?
body: <p>I need to extract the value <code>33345.002</code> from the following string:</p>
  
  <pre><code>"ABC(MAX)(33345.002)"
  </code></pre>
  
  <p>How can I perform this in C#?</p>
  
  <p>I tried handling it in SQL but was picking up the (MAX) too so now I'm gonna try C#.
  Thanks
  .
  .
  .</p>
  
  <p>This is the closest so far :</p>
  
  <pre><code>string temp = "YYY(33345.002)(gg)YYYY";
  temp = Regex.Replace(temp, "[^.0-9]", "");
  double num;
  bool success = Double.TryParse(temp, out num);
  
  if (success)
  {
  //do what ever to the number}
  </code></pre>
  
  <p>but there is a problem, some of the numbers have zeros in front of them. like: 00033.33</p>