You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Andrea Gaertner 668e16c315 Einkaufsliste application_liste hinzugefügt 3 years ago
..
index.js Einkaufsliste application_liste hinzugefügt 3 years ago
license Einkaufsliste application_liste hinzugefügt 3 years ago
package.json Einkaufsliste application_liste hinzugefügt 3 years ago
readme.md Einkaufsliste application_liste hinzugefügt 3 years ago

readme.md

url-regex Build Status

Regular expression for matching URLs

Based on this gist by Diego Perini.

Install

$ npm install --save url-regex

Usage

var urlRegex = require('url-regex');

urlRegex().test('http://github.com foo bar');
//=> true

urlRegex().test('www.github.com foo bar');
//=> true

urlRegex({exact: true}).test('http://github.com foo bar');
//=> false

urlRegex({exact: true}).test('http://github.com');
//=> true

'foo http://github.com bar //google.com'.match(urlRegex());
//=> ['http://github.com', '//google.com']

API

urlRegex(options)

Returns a regex for matching URLs.

options

exact

Type: boolean
Default: false (Matches any URL in a string)

Only match an exact string.
Useful with RegExp#test to check if a string is a URL.

License

MIT © Kevin Mårtensson and Diego Perini