fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Program
  5. {
  6. static void Main()
  7. {
  8. // First we see the input string.
  9. string input = "20,000";
  10.  
  11. // Here we call Regex.Match.
  12. Match match = Regex.Match(input, @"^\d*[-+,]?\d*$",
  13. RegexOptions.IgnoreCase);
  14.  
  15. // Here we check the Match instance.
  16. if (match.Success)
  17. {
  18. // Finally, we get the Group value and display it
  19. Console.WriteLine("successfully matched");
  20. }
  21. }
  22. }
Success #stdin #stdout 0.07s 34136KB
stdin
Standard input is empty
stdout
successfully matched