
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
babel-plugin-utf-8-regex
Advanced tools
Transforms a regular expression like /^\p{Cyrillic}+$/
to /^[Ѐ-҄҇-ԧᴫᵸⷠ-ⷿꙀ-ꚗꚟ]+$/
.
This Plugin was inspired by the unicode addon of xregexp. The list of possible types are explained here or can be found in the code. The most useful probably is \p{L}
or its alias \p{Letter}
which indicates any letter in any alphabet.
It also works with negations: either \P{L}
or \p{^L}
.
\p{TYPE}
into [TYPE-RANGES]
. This means that regular expressions like /[\p{Arabic}\p{Greek}]/
or /[^0-9\p{White_Space}]/
won't be correctly translated.So either commit a pull request or use something like /(\p{Arabic}|\p{Greek})/
for now.
npm install babel-plugin-utf-8-regex
Node API:
require("babel").transform("code", {
plugins: ["babel-plugin-utf-8-regex"]
});
CLI:
babel --plugins babel-plugin-utf-8-regex script.js
babelrc:
{
"plugins": ["babel-plugin-utf-8-regex"]
}
Contributions are more than welcome!
Clone this repo, hack around, add your tests and hit npm test
.
/\p{L}-\p{L}/
would be translated to something like var regexTypes = require("regexTypes"); [..] new RegExp(regexTypes.L+"-"+regexTypes.L)
FAQs
transforms regexes like /\p{Letter}/ into working js regexes
The npm package babel-plugin-utf-8-regex receives a total of 27 weekly downloads. As such, babel-plugin-utf-8-regex popularity was classified as not popular.
We found that babel-plugin-utf-8-regex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.