Regex Colorize
Color highlight your regex
Demo
See Slevithan's demo page
📦 Getting Started
npm
npm install regex-colorize --save
yarn
yarn add regex-colorize
Install
npm
; var rgx = ; rgx;...
self-host/cdn
<link href="https://unpkg.com/regex-colorize/themes/default.css" rel="stylesheet"> <script src="//unpkg.com/regex-colorize"></script> var RegexColorize = windowRegexColorizedefault; var rgx = ; // rgx.addStyleSheet();rgx;...
Usage
var rgx = ;//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 stylesheetrgx; // Can provide a class name for elements to process (defaults to class 'regex')rgx;
/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/
Themes
- default.css
- nobg.css
- regexbuddy.css
- regexpal.css
- sweetest.css (NEW)
Credits
The code is extracted from Regex Colorizer by slevithan