c#使用正则表达式匹配提取日期
时间:2021-09-24 04:58:58
收藏:0
阅读:64
string target_p ="2021/09/18";
string target_q ="2021-09-18";
格式yyyy/MM/dd:
MatchCollection mt = Regex.Matches(target_p , "([0-9]{4}/[0-9]{2}/[0-9]{2})");
格式yyyy-MM-dd:
MatchCollection mt = Regex.Matches(target_q, "([0-9]{4}-[0-9]{2}-[0-9]{2})");
原文:https://www.cnblogs.com/RainbowSea/p/15308524.html
评论(0)