fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string pattern = @"@([a-zA-Z]+)[^:]*:(\d+)!([AD])!->(\d+)";
  9. string input = @"PQ@Alderaa1:30000!A!->20000";
  10. foreach (Match m in Regex.Matches(input, pattern))
  11. {
  12. Console.WriteLine(m.Groups[1].Value);
  13. Console.WriteLine(m.Groups[2].Value);
  14. Console.WriteLine(m.Groups[3].Value);
  15. Console.WriteLine(m.Groups[4].Value);
  16. }
  17. }
  18. }
Success #stdin #stdout 0.03s 134592KB
stdin
Standard input is empty
stdout
Alderaa
30000
A
20000