JSPM

hashtag-regex-plus

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q28674F
  • License MIT

Enhanced fork of hashtag-regex by mathiasbynens

Package Exports

  • hashtag-regex-plus

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 (hashtag-regex-plus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hashtag-regex-plus

Based on the fantastic hashtag-regex by mathiasbynens. This fork contains my attempts to enhance the module by providing some options to it.

Installation

Via npm:

npm install https://github.com/tahara-san/hashtag-regex-plus.git

In Node.js:

const hashtagRegex = require('hashtag-regex-plus');
const regex = hashtagRegex({});
const isMatched = regex.test('#text');

Options:

const regex = hashtagRegex({ stripHash: false, forceEnd: false, forceStart: false});
/*
  stripHash: just look for hashtag body chars with excluding hash symbols.
  forceStart: a hashtag must be in the beginning of a string ( this option adds /^/ to the regex );
  forceEnd: a hashtag must be in the end of a string ( this option adds /$/ to the regex)
 */

License

hashtag-regex-plus is available under the MIT license.