{"name":"url-regex","version":"3.1.1","description":"Regular expression for matching URLs","license":"MIT","repository":{"type":"git","url":"git+https://github.com/kevva/url-regex.git"},"author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"https://github.com/kevva"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["regex","string","url"],"dependencies":{"ip-regex":"^1.0.1"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"ignores":["test.js"]},"gitHead":"17a7de34ba8dc5b9eefa8a56720702f3262f8c33","bugs":{"url":"https://github.com/kevva/url-regex/issues"},"homepage":"https://github.com/kevva/url-regex#readme","_id":"url-regex@3.1.1","_shasum":"8bbfea280d6b608fdd596a05fe102f7c3befa600","_from":".","_npmVersion":"3.7.0","_nodeVersion":"5.10.1","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"shasum":"8bbfea280d6b608fdd596a05fe102f7c3befa600","tarball":"http://registry-npm.ywwl.com/url-regex/download/url-regex-3.1.1.tgz","integrity":"sha512-oqXgbr0dxfwby36P4InEBgW3XDdM2CCGyfn3PeVskhXJILqpamI4sBoqImvVToxVz/biD0Hf8ZS6gxbpB/SUKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICx77+lz/v+b7O8PA3MB1moOppXIqqHwYpiATSaduYcWAiEAv/u2Cj3oa/5YFog6mpfzEI3byP5iudvDLO3uD9ThSK4="}],"size":1920,"noattachment":false,"key":"/url-regex/-/url-regex-3.1.1.tgz"},"maintainers":[{"name":"kevva","email":"kevinmartensson@gmail.com"},{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/url-regex-3.1.1.tgz_1460557818016_0.01159217837266624"},"directories":{},"readme":"# url-regex [![Build Status](http://img.shields.io/travis/kevva/url-regex.svg?style=flat)](https://travis-ci.org/kevva/url-regex)\n\n> Regular expression for matching URLs\n\nBased on this [gist](https://gist.github.com/dperini/729294) by Diego Perini.\n\n\n## Install\n\n```\n$ npm install url-regex\n```\n\n\n## Usage\n\n```js\nconst urlRegex = require('url-regex');\n\nurlRegex().test('http://github.com foo bar');\n//=> true\n\nurlRegex().test('www.github.com foo bar');\n//=> true\n\nurlRegex({exact: true}).test('http://github.com foo bar');\n//=> false\n\nurlRegex({exact: true}).test('http://github.com');\n//=> true\n\nurlRegex({strict: false}).test('github.com foo bar');\n//=> true\n\nurlRegex({exact: true, strict: false}).test('github.com');\n//=> true\n\n'foo http://github.com bar //google.com'.match(urlRegex());\n//=> ['http://github.com', '//google.com']\n```\n\n\n## API\n\n### urlRegex([options])\n\nReturns a `RegExp` for matching URLs.\n\n#### options\n\n##### exact\n\nType: `boolean`<br>\nDefault: `false`\n\nOnly match an exact string. Useful with `RegExp#test` to check if a string is a URL.\n\n##### strict\n\nType: `boolean`<br>\nDefault: `true`\n\nForce URLs to start with a valid protocol or `www`. If set to `false` it'll match the TLD against a list of valid [TLDs](https://github.com/stephenmathieson/node-tlds).\n\n\n## Related\n\n- [get-urls](https://github.com/sindresorhus/get-urls) - Get all URLs in text\n- [linkify-urls](https://github.com/sindresorhus/linkify-urls) - Linkify URLs in text\n\n\n## License\n\nMIT © [Kevin Mårtensson](https://github.com/kevva) and [Diego Perini](https://github.com/dperini)\n","publish_time":1460557820331,"_cnpm_publish_time":1460557820331,"dist-tags":{"latest":"5.0.0"}}