fork(2) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string str = "We are living in a <upcase>yellow submarine</upcase>. We don't have <upcase>anything</upcase> else.";
  9. string result = Regex.Replace(str, "(?<=<upcase>).*?(?=</upcase>)", m => m.ToString().ToUpper());
  10. Console.WriteLine(Regex.Replace(result, "</?upcase>", ""));
  11. Console.ReadLine();
  12. }
  13. }
Success #stdin #stdout 0.07s 34112KB
stdin
Standard input is empty
stdout
We are living in a YELLOW SUBMARINE. We don't have ANYTHING else.