Skip to content

Commit c464d24

Browse files
author
tunnckoCore
committed
update readme/meta
1 parent bbbf165 commit c464d24

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

README.md

+22-12
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,49 @@
44
[![Test coverage][coveralls-image]][coveralls-url]
55
[![Downloads][downloads-image]][downloads-url]
66

7-
Regular expression for usernames.
7+
Regular expression for usernames - it follows the same rules that GitHub uses.
88

99
## Installation
10-
```bash
10+
11+
```sh
1112
npm install regex-username
1213
```
1314

1415
## Usage
16+
1517
```js
1618
var regex = require('regex-username');
1719

18-
regex().test('tobi-ferret');
19-
// => true
20+
regex().test('foo-bar'); // => true
21+
regex().test('foobar'); // => true
22+
regex().test('3foobar'); // => true
23+
regex().test('3foo-bar'); // => true
24+
regex().test('foo-bar-'); // => false
25+
regex().test('-foo-bar'); // => false
26+
regex().test('foo--bar'); // => false
27+
regex().test('~derp@darp---++asdf'); // => false
28+
regex().test('[email protected]'); // => false
2029
```
2130

2231
## Why?
2332
Which usernames to allow typically varies between applications. For prototypes
2433
however it's nice to have an off the shelf solution. This module is that
2534
solution. It follows the same rules GitHub uses:
26-
> Username may only contain alphanumeric characters or dashes and cannot begin
27-
with a dash
35+
36+
> Username may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen.
2837
2938
## See Also
30-
- [regex-email](https://github.com/regexps/email)
39+
- [regex-email](https://github.com/regexhq/regex-email)
40+
- [youtube-regex](https://github.com/regexhq/youtube-regex)
3141

3242
## License
3343
[MIT](https://tldrlegal.com/license/mit-license)
3444

3545
[npm-image]: https://img.shields.io/npm/v/regex-username.svg?style=flat-square
36-
[npm-url]: https://npmjs.org/package/regex-username
37-
[travis-image]: https://img.shields.io/travis/regexps/regex-username.svg?style=flat-square
38-
[travis-url]: https://travis-ci.org/regexps/regex-username
39-
[coveralls-image]: https://img.shields.io/coveralls/regexps/regex-username.svg?style=flat-square
40-
[coveralls-url]: https://coveralls.io/r/regexps/regex-username?branch=master
46+
[npm-url]: https://www.npmjs.com/package/regex-username
47+
[travis-image]: https://img.shields.io/travis/regexhq/regex-username.svg?style=flat-square
48+
[travis-url]: https://travis-ci.org/regexhq/regex-username
49+
[coveralls-image]: https://img.shields.io/coveralls/regexhq/regex-username.svg?style=flat-square
50+
[coveralls-url]: https://coveralls.io/r/regexhq/regex-username?branch=master
4151
[downloads-image]: http://img.shields.io/npm/dm/regex-username.svg?style=flat-square
4252
[downloads-url]: https://npmjs.org/package/regex-username

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "regex-username",
33
"version": "1.0.0",
4-
"description": "Regular expression for usernames",
4+
"description": "Regular expression for usernames - it follows the same rules that GitHub uses.",
55
"main": "index.js",
66
"scripts": {
77
"test": "make test"
88
},
9-
"repository": "regexps/regex-username",
9+
"repository": "regexhq/regex-username",
1010
"keywords": [
1111
"regular expression",
1212
"regex",

0 commit comments

Comments
 (0)