Skip to content

Syntax highlight / coloring your regex pattern code.

Notifications You must be signed in to change notification settings

suk-ws/regex-colorizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Regex Colorizer

A JavaScript scripts to coloring the regex pattern.

how to use

first import the javascript & css file (you can use jsdelivr, or just download it to your own server).

<link rel="stylesheets" href="https://cdn.jsdelivr.net/gh/suk-ws/regex-colorizer@master/regex-colorizer-default.min.css">

<script src="https://cdn.jsdelivr.net/gh/suk-ws/regex-colorizer@master/regex-colorizer.min.js">

then using the following js code after the page loaded to run coloring :

RegexColorizer.coloringAll();
// this will coloring all the element with class name "regex",
// you can use RegexColorizer.coloringAll("your-own-regex-element-css-class"); to define a different class name.

About

The coloring idea is from RegExr. So the coloring rule and colors is basicly the same.

not fully the same, for one reason is it seems single / error is not such intelligent without js grammar, and the other reason is the regex grammar support is still simple for now.

There's also a test-use page you can see how's the coloring result.

About

Syntax highlight / coloring your regex pattern code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published