fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string s = "Here comes number on the consignment 1020289847AB.";
  9. Regex regex = new Regex(@"\d{10}\D{2}");
  10. Match match = regex.Match(s);
  11.  
  12. if (match.Success)
  13. {
  14. Console.WriteLine(match.Value);
  15. }
  16. }
  17. }
Success #stdin #stdout 0.06s 34112KB
stdin
Standard input is empty
stdout
1020289847AB