- preg_match: documentation ( source)
- print_r: documentation ( source)
<?php
$url = "https://dave.wistia.com/medias/0k5h1g1chs";
$regex = '%https*:\/\/.*(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*?)%';
preg_match( $regex, $url, $matches );
print_r ($matches);