
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
hashtag-regex
Advanced tools
A regular expression to match hashtag identifiers as per the Unicode Standard.
hashtag-regex offers a regular expression to match hashtag identifiers as per the Unicode Standard.
This repository contains a script that generates this regular expression based on the Unicode data. Because of this, the regular expression can easily be updated whenever the Unicode Standard changes.
Via npm:
npm install hashtag-regex
In Node.js:
const hashtagRegex = require('hashtag-regex');
// Note: because the regular expression has the global flag set, this module
// exports a function that returns the regex rather than exporting the regular
// expression itself, to make it impossible to (accidentally) mutate the
// original regular expression.
const text = `
#hashtag
#©
#🤷🏿♀️ (\uFF03\u{1F937}\u{1F3FF}\u200D\u2640\uFE0F)
`;
const regex = hashtagRegex();
let match;
while (match = regex.exec(text)) {
const hashtag = match[0];
console.log(`Matched sequence ${ hashtag } — code points: ${ [...hashtag].length }`);
}
Console output:
Matched sequence #hashtag — code points: 8
Matched sequence #© — code points: 2
Matched sequence #🤷🏿♀️ — code points: 6
Matched sequence #🤷🏿♀️ — code points: 6
Mathias Bynens |
hashtag-regex is available under the MIT license.
FAQs
A regular expression to match hashtag identifiers as per the Unicode Standard.
The npm package hashtag-regex receives a total of 4,382 weekly downloads. As such, hashtag-regex popularity was classified as popular.
We found that hashtag-regex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.