fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var numAlpha = new Regex(@"(?<Numeric>[0-9]*\.?[0-9]+)(?<Alpha>[a-z]+)", RegexOptions.IgnoreCase);
  12. var match = numAlpha.Match("1.65B");
  13. if (match.Success)
  14. {
  15. var number = match.Groups["Numeric"].Value;
  16. var alpha = match.Groups["Alpha"].Value;
  17. Console.WriteLine("Number: {0}, Alpha: {1}", number, alpha);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.04s 133824KB
stdin
Standard input is empty
stdout
Number: 1.65, Alpha: B