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.