fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var input = "Te1xt32";
  9. var regex = new Regex(@"^(.+)(?<Number>\d+)\z", RegexOptions.RightToLeft);
  10.  
  11. Match m = regex.Match(input, input.Length);
  12.  
  13. Console.WriteLine(m.Groups[1].Value);
  14. Console.WriteLine(m.Groups["Number"].Value);
  15. }
  16. }
Success #stdin #stdout 0.07s 34024KB
stdin
Standard input is empty
stdout
Te1xt
32