开发者

Python Regex To VB.net

开发者 https://www.devze.com 2022-12-28 03:42 出处:网络
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?

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

精彩评论

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