fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Test {
  5. static void Main() {
  6. string filename = "Try123_Enrollment_20130102_1200.xml";
  7. Regex pattern = new Regex(@"^[A-Za-z0-9]+_Enrollment_[0-9]{8}_[0-9]{4}\.xml$");
  8. if (pattern.IsMatch(filename))
  9. {
  10. Console.WriteLine("Matched");
  11. }
  12. }
  13. }
Success #stdin #stdout 0.07s 33992KB
stdin
Standard input is empty
stdout
Matched