Javascript examples for RegExp:RegExp Match
Get videoId of Vimeo with Regex
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w w w . j a v a 2s. c o m var videoId ='http://vimeo.com/169473112'; var regExp = /vimeo.*(?:\/|clip_id=)([0-9a-z]*)/i; var $body = document.querySelector('body'); var parsed = videoId.match(regExp) + '<br />'; $body.innerHTML += parsed; } </script> </head> <body> </body> </html>