标签:command logs 正则表达 pre show success span blog led
使用一个不错的正则表达式来配对一个正确的url.
string reg = @"(?i)(http://|https://)?(\w+\.){1,3}(com(\.cn)?|cn|net|info|org|us|tk)\b"; Regex r = new Regex(reg); textEditUrl.Text = textEditUrl.Text.Trim(); Match match = r.Match(textEditUrl.Text); if (!match.Success) { CustomControls.MessageErrDlg dlg = new CustomControls.MessageErrDlg(); dlg.Text = "Remote Command Failed"; dlg.ShowDialog(); textEditUrl.Text = "http://"; }
标签:command logs 正则表达 pre show success span blog led
原文地址:http://www.cnblogs.com/qq702368956/p/6587886.html