Regular expressions help required
To extract "w6OyOZXoq14" from the string https://www.youtube.com/watch?v=w6OyOZXoq14
we can use the below preg_match in php.
preg_match('/^https?:\/\/(www\.)?((?!.*list=)youtube\.com\/watch\?.*v=|youtu\.be\/)(?<id>[0-9A-Za-z_-]*)/', $input, $matches);
return isset($matches['id']) ? $matches['id'] : FALSE;
Similarly I need to extract "dollarvigilante/4iknjlwx" from "https://dtube.video/#!/v/dollarvigilante/4iknjlwx"
Can somebody lend a quick helping hand? I generally head to stackoverlfow for these kinds of queries. Trying to see if it can work on steemit itself.
Lovely that was handy. Thanks for the quick response.
Check this site.
https://regular-expressions.mobi/tutorial.html?wlr=1