Код: Выделить всё
/root/test/subfolder/
relative/folder/
index.html
/root/test/style.css
test/test2/test3/testN/
Regex re = new Regex(@"^(/?)([\w\.]+/)*([\w\.]+)?$");
foreach (Group gr in re.Match("/templates/base/test/header.html").Groups)
Console.WriteLine(gr + " @ " + gr.Index.ToString());
Console.ReadKey();
< /code>
Я хочу, чтобы сначала была невиновна, а затем путь с /в конце и необязательное имя файла в конце. < /p>
Подробнее здесь: https://stackoverflow.com/questions/664 ... g-patterns
Мобильная версия