
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
regex-colorize
Advanced tools
Color highlight your regex
See Slevithan's demo page
npm
npm install regex-colorize --save
yarn
yarn add regex-colorize
import RegexColorize from 'regex-colorize';
import 'regex-colorize/themes/default.css' // If you import a css file in your library
var rgx = new RegexColorize();
rgx.colorizeAll();
...
<link href="https://unpkg.com/regex-colorize/themes/default.css" rel="stylesheet">
<script src="//unpkg.com/regex-colorize"></script>
var RegexColorize = window.RegexColorize.default;
var rgx = new RegexColorize();
// rgx.addStyleSheet();
rgx.colorizeAll();
...
var rgx = new RegexColorize();
//new RegexColorize('my-regex'); to customize class names
//note that themes won't work with different class names, so edit the css files as well
// Don't run this line if you provide your own stylesheet
rgx.addStyleSheet();
// Can provide a class name for elements to process (defaults to class 'regex')
rgx.colorizeAll();
<code class="regex">/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/</code>
The code is extracted from Regex Colorizer by slevithan
FAQs
Highlighter for JavaScript regex syntax
The npm package regex-colorize receives a total of 578 weekly downloads. As such, regex-colorize popularity was classified as not popular.
We found that regex-colorize 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.