UNPKG

copyright-regex

Version:

Regex for matching and parsing copyright statements.

76 lines (49 loc) 2.5 kB
# copyright-regex [![NPM version](https://img.shields.io/npm/v/copyright-regex.svg?style=flat)](https://www.npmjs.com/package/copyright-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/copyright-regex.svg?style=flat)](https://npmjs.org/package/copyright-regex) [![NPM total downloads](https://img.shields.io/npm/dt/copyright-regex.svg?style=flat)](https://npmjs.org/package/copyright-regex) [![Linux Build Status](https://img.shields.io/travis/regexhq/copyright-regex.svg?style=flat&label=Travis)](https://travis-ci.org/regexhq/copyright-regex) > Regex for matching and parsing copyright statements. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save copyright-regex ``` ## Usage ```js var regex = require('copyright-regex'); var str = 'abc\nCopyright (c) 2013-2015, 2016, Jon Schlinkert.\nxyz'; var matches = str.match(regex()); // matches[0] => 'Copyright (c) 2013-2015, 2016, Jon Schlinkert' // matches[1] => 'Copyright' // matches[2] => '(c)' // matches[3] => '2013-2015, 2016, ' // matches[4] => '2016' // matches[5] => 'Jon Schlinkert' ``` ## About ### Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). ### Contributors | **Commits** | **Contributor**<br/> | | --- | --- | | 18 | [jonschlinkert](https://github.com/jonschlinkert) | | 1 | [arthurvr](https://github.com/arthurvr) | | 1 | [tunnckoCore](https://github.com/tunnckoCore) | | 1 | [pdehaan](https://github.com/pdehaan) | ### Building docs _(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ To generate the readme and API documentation with [verb](https://github.com/verbose/verb): ```sh $ npm install -g verb verb-generate-readme && verb ``` ### Running tests Install dev dependencies: ```sh $ npm install -d && npm test ``` ### Author **Jon Schlinkert** * [github/regexhq](https://github.com/regexhq) * [twitter/regexhq](http://twitter.com/regexhq) ### License Copyright © 2016, [Jon Schlinkert](https://github.com/regexhq). Released under the [MIT license](https://github.com/regexhq/copyright-regex/blob/master/LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 07, 2016._