我要提取所有有此caracters之间:正则表达式来提取URL
<a href="/url?q=(text to extract whatever it is)&
我尝试这种模式,但它不是为我工作:
/(?<=url\?q=).*?(?=&)/
我在编程Vb.net,这是代码,但我认为问题是这种模式是错误的:
Dim matches As MatchCollection
matches = regex.Matches(TextBox1.Text)
For Each Match As Match In matches
listbox1.items.add(Match.Value)
Next
你能帮我吗?
我在http://rubular.com/测试您的正则表达式和它的确定。 – dotoree 2012-03-03 17:35:46