{"name":"url-regex","version":"4.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":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["regex","string","url"],"dependencies":{"ip-regex":"^1.0.1","tlds":"^1.187.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"1e9fdb9d320a44168d1f3f255622d02badb20113","bugs":{"url":"https://github.com/kevva/url-regex/issues"},"homepage":"https://github.com/kevva/url-regex#readme","_id":"url-regex@4.1.1","_npmVersion":"5.0.3","_nodeVersion":"8.0.0","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"integrity":"sha512-ViSDgDPNKkrQHI81GLCjdDN+Rsk3tAW/uLXlBOJxtcHzWZjta58Z0APXhfXzS89YszsheMnEvXeDXsWUB53wwA==","shasum":"a5617b22e15e26dac57ce74c3f52088bcdfec995","tarball":"http://registry-npm.ywwl.com/url-regex/download/url-regex-4.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDMMP6CHGUOujyiWYKV9lDHS4cHM5+rTMFiZKHU/+twgIhAJWqGA3xY6tdB4sDD9GQII7NhWj0R9rzFZx6WsHamLw5"}],"size":2192,"noattachment":false,"key":"/url-regex/-/url-regex-4.1.1.tgz"},"maintainers":[{"name":"kevva","email":"kevinmartensson@gmail.com"},{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-regex-4.1.1.tgz_1497356750683_0.571814741473645"},"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":1497356751619,"_cnpm_publish_time":1497356751619,"dist-tags":{"latest":"5.0.0"}}