views:

40

answers:

1

Hi everyone, 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&SomeOtherContent

Thank you

+1  A: 

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");
Kobi
geek1983