fork download
  1. using System;
  2. using System.Text;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. string text = "<strong>Date of Hire: </strong>November 2, 2015<br />";
  10. string foundMatch = "No match found";
  11. Regex dateFormat = new Regex("(January|February|March|April|May|June|July|August|September|October|November|December) [0-9]{1,2}, [0-9]{4}");
  12. MatchCollection matches = dateFormat.Matches(text);
  13. if(matches.Count > 0)
  14. {
  15. foundMatch = matches[0].ToString();
  16. }
  17. Console.WriteLine(foundMatch);
  18. }
  19. }
Success #stdin #stdout 0.12s 24344KB
stdin
Standard input is empty
stdout
November 2, 2015