fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Demo {
  5. public static void Main()
  6. {
  7. string str = "{ name: \"Phai dấu cuộc tình\", mp3: \"audio\\16\\Phai dau cuoc tinh.mp3\"},{ name: \"Caravan of life\", mp3: \"audio\\4\\Caravan of life.mp3\"},{ name: \"I'm Forbidden\", mp3: \"audio\\11\\I'm Forbidden.mp3\"},{ name: \"Cause i love you\", mp3: \"audio\\6\\Cause i love you.mp3\"},{ name: \"Chỉ là giấc mơ\", mp3: \"audio\\8\\Chi la giac mo.mp3\"},{ name: \"Lột xác\", mp3: \"audio\\12\\Lot xac.mp3\"}";
  8.  
  9. foreach (var match in Regex.Matches(str, @"(?<=\\)(\d+)(?=\\)"))
  10. Console.WriteLine(match);
  11. }
  12. }
Success #stdin #stdout 0.06s 33976KB
stdin
Standard input is empty
stdout
16
4
11
6
8
12