using System.Text.RegularExpressions;
public static void Main()
const string source = "~/Areas/Teste/Views/home/index.cshtml";
Regex regex = new Regex("^~/Areas/(?<output>[a-zA-Z0-9]+)/*/.*");
GroupCollection capturas = regex.Match(source).Groups;
Console.WriteLine(capturas["output"]);