开发者

Python Regex To VB.net

I made a program in Python and now I whant to transfert it to vb.net. But I have some difficulties with the vb.net regular expression.... Someone can help me please?

There are my Python regex:

id = re.search('(?<=watch\?v\=)[\w|-]+|(?<=/v/)[\w|-]+', src)
id = id.group(0)

t = re.search('(?<=\&t\=)[\w|-]+', src)
t = t.group()

It's supposed to fin the value of ?v=Value&SomeOtherContent and &t=Value&SomeOtherCo开发者_开发知识库ntent

Thank you


An easy way to parse query strings is by using a NameValueCollection, using the HttpUtility.ParseQueryString method. This also takes care of encoding.

For example:

NameValueCollection parameters = HttpUtility.ParseQueryString("?var1=1&var2=2");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜