title: Regular Expression to find a GUID string in a txt file with "id=" attached to it
body: <p>The code below works well and the goal is to find a GUID string inside a XML file. So it will find the string <code>A03DD607-90BF-4077-ADA8-C6E76F9D4759</code> for instance but now I am trying to change the regular expression to only find:</p>
  
  <p><code>id="A03DD607-90BF-4077-ADA8-C6E76F9D4759"</code>  </p>
  
  <p>rather than</p>
  
  <p><code>A03DD607-90BF-4077-ADA8-C6E76F9D4759</code></p>
  
  <p>Here is my code:</p>
  
  <pre><code>    //obtain all GUIDs in the XML file
      using (StreamReader sr = File.OpenText(xmlFile))
      {
          string s = String.Empty;
          while ((s = sr.ReadLine()) != null)
          {
              MatchCollection guids = Regex.Matches(s, @"(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}");
              for (int i = 0; i &lt; guids.Count; i++)
              {
                  Console.WriteLine(guids[i].Value);
                  guidList.Add(guids[i].Value.ToUpper());
              }
          }
      }
  </code></pre>