JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1136
  • Score
    100M100P100Q129753F
  • License

100% twitter compatible `@mentions` regex! Regular expression for matching `@username` mentions, as used on twitter, facebook, github, etc.

Package Exports

  • mentions-regex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mentions-regex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm versi mit license build status coveralls img deps status

100% twitter compatible @mentions regex! Regular expression for matching @username mentions, as used on twitter, facebook, github, etc.

Install

npm i --save mentions-regex
npm test

metntionsRegex

Compatible twitter mentions regex, not only of course!

  • [dot] {Boolean} if true it will allow to match dots
  • return {RegExp}

Usage

For more use-cases see tests

var metntionsRegex = require('metntions-regex');

metntionsRegex().test('foo @bar baz');
//=> true

metntionsRegex().exec('foo @bar baz')[1];
//=> 'bar'

metntionsRegex().test('foo email@bar.com baz');
//=> false

metntionsRegex(true).test('foo email@bar.com baz');
//=> false

metntionsRegex(true).test('foo @bar.com baz');
//=> true

metntionsRegex(true).exec('foo @bar.com baz')[1];
//=> 'bar.com'

Author

Charlike Mike Reagent

License MIT license

Copyright (c) 2014-2015 Charlike Mike Reagent, contributors.
Released under the MIT license.


Proudly generated with docks(1) on March 28, 2015