fork(5) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string pattern = @"[a-zA-Z\/]+";
  8. string input = @"...
  9. 1.1SMITH/JOHN 2.1SMITH/SARA
  10. ...
  11. 1.1Parker/Sara/Amanda.CH07/Elizabeth.IN03";
  12.  
  13. foreach (Match m in Regex.Matches(input, pattern))
  14. {
  15. Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
  16. }
  17. }
  18. }
Success #stdin #stdout 0.02s 30136KB
stdin
Standard input is empty
stdout
'SMITH/JOHN' found at index 7.
'SMITH/SARA' found at index 21.
'Parker/Sara/Amanda' found at index 39.
'CH' found at index 58.
'/Elizabeth' found at index 62.
'IN' found at index 73.