Skip to content

Commit c220ca2

Browse files
author
Charlike Mike Reagent
committed
add more to usage
1 parent 49a3c90 commit c220ca2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

readme.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mentionsRegex({flags: 'g'}).test('github @tunnckoCore')
2626
mentionsRegex({endSpace: false}).test('github @tunnckoCore')
2727
//=> true
2828

29-
var str = '@first github @tunnckoCore and @face some @al.so [email protected] global @last'
29+
var str = '@first git @tunnckoCore and @face some @al.so [email protected] glob @last'
3030

3131
str.match(mentionsRegex())
3232
//=> [' @tunnckoCore ']
@@ -51,6 +51,12 @@ str.match(mentionsRegex({flags: 'g', dot: true}))
5151

5252
str.match(mentionsRegex({flags: 'g', dot: true, length: 5}))
5353
//=> [' @face ', ' @al.so ']
54+
55+
str.match(mentionsRegex({flags: 'g', dot: true, startSpace: false}))
56+
//=> ['@first ', '@tunnckoCore ', '@face ', '@al.so ', '@here.com ']
57+
58+
str.match(mentionsRegex({flags: 'g', dot: true, startSpace: false, endSpace: false}))
59+
//=> ['@first', '@tunnckoCore', '@face', '@al.so', '@here.com ', '@last']
5460
```
5561

5662

test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
'use strict';
99

1010
var mentionsRegex = require('./index');
11-
var str = '@first github @tunnckoCore and @face some @al.so [email protected] global @last'
12-
var res = str.match(mentionsRegex({flags: 'g', startSpace: false}))
11+
var str = str = '@first git @tunnckoCore and @face some @al.so [email protected] glob @last'
12+
var res = str.match(mentionsRegex({flags: 'g', dot: true, startSpace: false, endSpace: false}))
1313
console.log(res)

0 commit comments

Comments
 (0)