Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VB.net正则表达式(网站提取器)_Vb.net_Debugging - Fatal编程技术网

VB.net正则表达式(网站提取器)

VB.net正则表达式(网站提取器),vb.net,debugging,Vb.net,Debugging,到目前为止,我有这个 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim regx As New Regex("https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?", RegexOptions.IgnoreCase) Dim mactches As MatchCollection = regx.Matches(Input)

到目前为止,我有这个

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim regx As New Regex("https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?", RegexOptions.IgnoreCase)

Dim mactches As MatchCollection = regx.Matches(Input)
For Each match As Match In mactches
    TbOutput.Text = TbOutput.Replace(match.Value, [String].Format("<a href=""{0}"" target=""_blank"">{0}</a>", match.Value))
Next

我想知道我做错了什么。TbOutput.Text=TbOutput.Replace出现错误,然后我输入了一个.Split,但也不起作用,再加上我的regx.matcheInput出现错误。输入部分给了我一个错误。我想知道是否必须在其中添加其他内容。

什么类型的错误?输入的具体内容是什么?另外,我相当肯定错误主要是因为您需要TbOutput.Text.Replace;文本框不是字符串,因此几乎没有相同的方法。For循环中也有一个输入错误,但是呃。