标签:
 private static void getPathAndFilename(String logFolder)
        {
            string img = "C:\\Users\\jiawang\\Perforce\\EASAP\\jiawang_EASHDPDESK257_6678\nucleus\\SANDBOX\\henryzhu\\ProductAPIValidator\\ProductAPIValidator\\bin\\Debug\\log_info.log";
            string regex2 = @"^(?<fpath>([a-zA-Z]:\\)([\s\.\-\w]+\\)*)(?<fname>[\w]+.[\w]+)";
System.Text.RegularExpressions.Match result = System.Text.RegularExpressions.Regex.Match(img, regex2);
            if (result.Success)
            {
                Console.WriteLine("[Full]:" + result.Value);
                Console.WriteLine("[Part1]:" + result.Result("${fpath}"));
                Console.WriteLine("[Part2]:" + result.Result("${fname}"));
            }
            Console.ReadLine();
}
标签:
原文地址:http://www.cnblogs.com/leonkennedy2015/p/5908543.html