Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

regex scan youtube video id

function linkifyYouTubeURLs(text) {
    var re = /https?://(?:[0-9A-Z-]+.)?(?:youtu.be/|youtube(?:-nocookie)?.comS*?[^ws-])([w-]{11})(?=[^w-]|$)(?![?=&+%w.-]*(?:['"][^<>]*>|</a>))[?=&+%w.-]*/ig;
    return text.replace(re,'$1');
}
Source by # #
 
PREVIOUS NEXT
Tagged: #regex #scan #youtube #video #id
ADD COMMENT
Topic
Name
7+2 =