110,534
社区成员
发帖
与我相关
我的任务
分享
string str = "http://fsdf.com/sf/wef.jsnmbnmhttp://fwe.com/sf/adf.jsbnmnhttp://hjg.com/sf/adf.jsbmnbhttp://jyt.com/sf/adf.js";
Regex re = new Regex(@"([\w-]+\.)+[\w-]+.([^a-z])(/[\w- ./?%&=]*)?|[a-zA-Z0-9\-\.][\w-]+.([^a-z])(/[\w- ./?%&=]*)?\.js");
foreach (Match m in re.Matches(str))
Console.WriteLine(m.Value);
string str = "http://fsdf.com/sf/wef.jsnmbnmhttp://fwe.com/sf/adf.jsbnmnhttp://hjg.com/sf/adf.jsbmnbhttp://jyt.com/sf/adf.js";
Regex reg = new Regex(@"(?is)http://.*?\.js");
MatchCollection mc = reg.Matches(str);
foreach (Match m in mc)
{
richTextBox2.Text += m.Value + "\n";
}