|
-
Oct 17th, 2010, 10:04 AM
#1
[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';
-
Oct 17th, 2010, 10:25 AM
#2
Fanatic Member
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
Last edited by J-Deezy; Oct 17th, 2010 at 10:36 AM.
If I helped you out, please take the time to rate me 
-
Oct 17th, 2010, 10:45 AM
#3
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
-
Oct 17th, 2010, 10:52 AM
#4
Fanatic Member
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)
If I helped you out, please take the time to rate me 
-
Oct 17th, 2010, 11:03 AM
#5
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-]
??
-
Oct 17th, 2010, 11:11 AM
#6
Fanatic Member
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"
Last edited by J-Deezy; Oct 17th, 2010 at 11:18 AM.
If I helped you out, please take the time to rate me 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|