fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. // your code goes here
  9. string resultString = null;
  10. try {
  11. string subjectString = "alabala-1000 Intern";
  12. resultString = Regex.Replace(subjectString, @"(.+)-(\d+)\s+(.+)", @"$1/$1-$2/$3");
  13. Console.WriteLine(resultString);
  14. } catch (ArgumentException ex) {
  15. // Syntax error in the regular expression
  16. }
  17.  
  18. }
  19. }
Success #stdin #stdout 0.03s 134720KB
stdin
Standard input is empty
stdout
alabala/alabala-1000/Intern