summaryrefslogtreecommitdiff
path: root/desktop/node_modules/author-regex/README.md
blob: 129534c0578401f8c63a4d036db703d7e061e75e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# author-regex [![NPM version](https://badge.fury.io/js/author-regex.svg)](http://badge.fury.io/js/author-regex)


> Regular expression for parsing an `author` string into an object following npm conventions.

This the regex used by [parse-authors](https://github.com/jonschlinkert/parse-authors).


**Related**

 - [parse-author](https://github.com/jonschlinkert/parse-author)
 - [parse-authors](https://github.com/jonschlinkert/parse-authors)


## Install
#### Install with [npm](npmjs.org)

```bash
npm i author-regex --save
```
#### Install with [bower](https://github.com/bower/bower)

```bash
bower install author-regex --save
```

## Tests

Run

```bash
npm test
```

## Usage

```js
var re = require('author-regex');

function authors(str) {
  return re().exec(str);
}
console.log(author('Jon Schlinkert <foo@bar.com> (https://github.com/jonschlinkert)'));
```
Returns:

```js
[ 'Jon Schlinkert <foo@bar.com> (https://github.com/jonschlinkert)',
  'Jon Schlinkert',
  'foo@bar.com',
  'https://github.com/jonschlinkert',
  index: 0,
  input: 'Jon Schlinkert <foo@bar.com> (https://github.com/jonschlinkert)' ]
```

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License
Copyright (c) 2014 Jon Schlinkert, contributors.  
Released under the MIT license

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 29, 2014._