标签:字符 inf ali ups var pattern group date ati
var time = "";
string pattern = @"_(?<time>20\d{6})";
var regResult = Regex.Match(fileName, pattern);
if (regResult.Success)
{
time = regResult.Groups["time"].ToString();
}
var uploadDate = DateTime.ParseExact(time, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture);
C# 正则表达式匹配string字符串中的时间串(yyyyMMdd)
标签:字符 inf ali ups var pattern group date ati
原文地址:https://www.cnblogs.com/zx724792526/p/11724009.html