110,534
社区成员
发帖
与我相关
我的任务
分享
var str='000131年全080916年上100325年下141228事全150530年全170809事全180903事下';
str=str.replace(/(?!1[45])\d{2}[01]\d[0123]\d[\u4e00-\u9fa5]{2}/g,'');
alert(str);
i = Today.ToString.Substring(2, 2)
For Each drdr As DataRow In 用户列表.DataSource.rows
s = ""
For Each match As Match In Regex.Matches(n2s(drdr("请假详情")), "[" & i - 1 & "|" & i & "]{2}\d{4}[\u4e00-\u9fa5]{2}")
s &= match.Value
Next
drdr("请假详情") = s
Next
(1[45]\d{4}).{2}
对match.Group[1].Value进行ParseDate判断1[45]\d{4}.{2}
然后再对Match的值进行判断
string oldStr = "140530年全";
string newStr = Regex.Replace(oldStr, "(?<=1[45])\\d{4}[\\u4e00-\\u9fa5]{2}", "替换内容");
MessageBox.Show ("替换前的字符串:" + oldStr + Environment .NewLine + "替换后的字符串:" + newStr);
(?<=1[45])\d{4}[\u4e00-\u9fa5]{2}