fork download
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Globalization;
  5. using System.Diagnostics;
  6. using System.Net;
  7. using System.Text;
  8. using System.Configuration;
  9. using System.Text.RegularExpressions;
  10.  
  11. namespace ProgramConsole
  12. {
  13. public class Program
  14. {
  15. public static void Main(string[] args)
  16. {
  17. string chars = "091";
  18. string ss = "763091d44a0914";
  19. IList<int> indexes = new List<int>();
  20. foreach ( Match match in Regex.Matches(ss, chars) )
  21. {
  22. indexes.Add(match.Index);
  23. }
  24.  
  25. for (int i = 0; i < indexes.Count; i++)
  26. {
  27. Console.WriteLine("{0}. match in index {1}", i+1, indexes[i]);
  28. }
  29. }
  30. }
  31.  
  32. }
Success #stdin #stdout 0.07s 34096KB
stdin
Standard input is empty
stdout
1. match in index 3
2. match in index 10