title: Why doesn't this Regex match the date part of the input?
body: <p>I am attempting to take an Object's text value, obtain information from it through a Regex, and then type that output to Notepad. Below is my code, and the object references are all correct. I have been able to type other information to Notepad, including the full text of the object whose Regex I am trying to extract, so I assume there is a problem with the Match.Groups[1].Value, but I can't seem to figure it out. </p>
  
  <pre><code>string pattern= @".*[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}\s[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\s(A|P)M$";
  string input = repo.ChangedByDate.Element.GetAttributeValueText("Text");
  
  Match match = Regex.Match(input, pattern);
  
  string dateRegex = match.Groups[1].Value;
  
  Notepad.Textbox.PressKeys(dateRegex);
  </code></pre>
  
  <p><strong>EDIT:</strong>
  Apologies, I posted too quickly and without more pertinent information.</p>
  
  <p>The above code is meant to match only the date/time portion of a string whose original text is:</p>
  
  <pre><code>Current date and time is: 8/7/2013 12:15:02 PM
  </code></pre>
  
  <p>So all I want to extract is <code>8/7/2013 12:15:02 PM</code> with the regex assigned to <code>pattern</code>.</p>
  
  <p>As of now, no output is being placed into Notepad. However, if I were to change the code to just the following:</p>
  
  <pre><code>string input = repo.ChangedByDate.Element.GetAttributeValueText("Text");
  
  Notepad.Textbox.PressKeys(input);
  </code></pre>
  
  <p>My output in Notepad is <code>Current date and time is: 8/7/2013 12:15:02 PM</code></p>