Craig Lambie
asked on
Help me write some RegEx to use in Preg_Match - pull Wistia Video ID from URL
Hi there,
I haven't ever got my head around RegEx sorry - and this is a once off.
Can someone give me the preg_match RegEx required to pull the "ID" from this URL
http://auspicious.wistia.com/medias/ze56j8drs1?embedType=api&videoFoam=t rue&videoW idth=640
The id is ze56j8drs1
The URL could be
http(s)://*wistia.com/medi as/*
http(s)://*wistia.com/embe d/*
http(s)://*wi.st/medias/*
http(s)://*wi.st/embed/*
The guide on this page didn't help http://wistia.com/doc/construct-an-embed-code
Nor did "RegEx Buddy"
Thanks so much in advance RegEx experts :) I am sure this is simple as :)
I haven't ever got my head around RegEx sorry - and this is a once off.
Can someone give me the preg_match RegEx required to pull the "ID" from this URL
http://auspicious.wistia.com/medias/ze56j8drs1?embedType=api&videoFoam=t
The id is ze56j8drs1
The URL could be
http(s)://*wistia.com/medi
http(s)://*wistia.com/embe
http(s)://*wi.st/medias/*
http(s)://*wi.st/embed/*
The guide on this page didn't help http://wistia.com/doc/construct-an-embed-code
Nor did "RegEx Buddy"
Thanks so much in advance RegEx experts :) I am sure this is simple as :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the tip Dan - I will take that aboard - although I think RegEx seems so simple if I only took the time to understand it (the very odd occasion I need it)
Ray - Noted, and appreciate your reply, but will use the simple version from Dan for now - if it breaks, it breaks.
I will keep this A in case and reference it in the Wordpress Plugin I am developing for this.