[RESOLVED] spot the regex misstake
Can any one spot the miss take
Code:
Private firstRegex As String = "http://www\.mixcloud\.com/api/1/cloudcast/[\w\d]+.json?embed_type=website_unknown"
Two examples of the url for you
Code:
'http://www.mixcloud.com/api/1/cloudcast/lamixette/lamixette46-danny-drive-thru.json?embed_type=website_unknown';
'http://www.mixcloud.com/api/1/cloudcast/LaidBackRadio/fatoosan-supafly-indian-summer.json?embed_type=website_unknown';
Re: spot the regex misstake
Well for starters, before the ".json" you forgot to cancel the ".", same with the following "?" also, the URL contains "-" in the section where you only used \w and \d
Try this (can't be bothered opening VB so hope it works)
Code:
Dim pattern as string = "http://www\.mixcloud\.com/api/1/cloudcast/[\w\d-]+\.json\?embed_type=website_unknown"
If it doesn't work I'll open VB and see if I can get it
EDIT, looking at it you forgot another section :)
Dim pattern As String = "http://www\.mixcloud\.com/api/1/cloudcast/[\w\d-]+/[\w\d-]+\.json\?embed_type=website_unknown"
that should work, i think
Re: spot the regex misstake
Thanks once again J-Deezy. I thought i would start practicing Regex after your post yesterday.
Feel a bit silly i missed canceling them bits now
Re: spot the regex misstake
Hehe no problemo. I like spotting the Regex threads as it gives me a chance to practice it :)
(I hope you also saw the missing part of the pattern I edited in as well)
Re: spot the regex misstake
Yes i see that <--- wolly
I'm sure i will have plenty more regex query for you. One question. You added - [\w\d-] for the part where it contained - between the / / But why did the first one. the one i had missed need a - [\w\d-]
??
Re: [RESOLVED] spot the regex misstake
Oh I just used the same combination as I wasn't 100% sure of the structure for the URL, who knows?
Code:
"http://www\.mixcloud\.com/api/1/cloudcast/[\w\d]+/[\w\d-]+\.json\?embed_type=website_unknown"
Would probably still work, but if any URLs had /1/cloudcast/word-name/example-lol.......
it wouldn't match them as there is a "-" in the 1st block.
EDIT: Revised pattern (much simpler)
Code:
Dim mPattern As String = "http://www\.mixcloud\.com/api/1/cloudcast/.+/.+\.json\?embed_type=website_unknown"