Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

youtube-regex

1.0.5 • Public • Published

youtube-regex NPM version Build Status Coveralls regexps org

The correct Youtube video id regex. Regex done right!

Install Nodei.co stats

Install with npm

$ npm install youtube-regex
$ npm test

Online

Usage

var youtubeRegex = require('youtube-regex');
 
// contains youtube url address
youtubeRegex().test('unicorn youtube.com/watch?v=0EWbonj7f18');
//=> true
 
// also these will works
youtubeRegex().test('youtube.com/watch?v=0EWbonj7f18');
//=> true
youtubeRegex().test('youtube.com/watch?feature=related&v=0EWbonj7f18');
//=> true
youtubeRegex().test('youtube.com/watch?v=0EWbonj7f18&feature=related');
//=> true
youtubeRegex().test('http://www.youtube.com/watch?v=0EWbonj7f18');
//=> true
youtubeRegex().test('http://www.youtube.com/watch?feature=related&v=0EWbonj7f18');
//=> true

For more use-cases see tests

Authors & Contributors

Charlike Mike Reagent author tips

License MIT license

Copyright (c) 2014 Charlike Mike Reagent, contributors.
Released under the MIT license.

install

npm i youtube-regex

Downloadsweekly downloads

414

version

1.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability