Link to home
Start Free TrialLog in
Avatar of Craig Lambie
Craig LambieFlag for Australia

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=true&videoWidth=640

The id is ze56j8drs1
The URL could be
http(s)://*wistia.com/medias/*
http(s)://*wistia.com/embed/*
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
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Craig Lambie

ASKER

Fantastic response !

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.