fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string myString = "blah blah **[10]** blah **[20]** and some more blah **[30]**";
  9. Regex myIDsReg = new Regex(@"\*\*\[(\d+)\]\*\*");
  10. foreach (Match match in myIDsReg.Matches(myString))
  11. {
  12. Console.WriteLine(match.Groups[1]);
  13. }
  14. }
  15. }
Success #stdin #stdout 0.08s 38384KB
stdin
Standard input is empty
stdout
10
20
30