Need help with regulex?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

4.8K Stars 615 Forks MIT License 41 Commits 20 Opened issues


:construction: Regular Expression Excited!

Services available


Need anything else?

Contributors list

# 8,406
41 commits


Regulex is a JavaScript Regular Expression Parser & Visualizer.

Try it now:

This project is under reconstruction!


  • Written in pure JavaScript. No backend required.
  • You can embed the graph on you own site through HTML iframe element.
  • Detailed error message. In most cases it can point out the precise syntax error position.
  • No support for octal escape. Yes it is a feature! ECMAScript strict mode doesn't allow octal escape in string, but many browsers still allow octal escape in regex. In regulex, DecimalEscape will always be treated as back reference. If the back reference is invalid, e.g.
    , or DecimalEscape appears in charset(because in this case it can't be explained as back reference, e.g.
    , Regulex will always throw an error.

Install for Node.js

npm install regulex

Local Build for Browser

This command will generate bundle

for browser side:
git checkout legacy
npm install -g requirejs
r.js -o build-config.js


Parse to AST

var parse = require("regulex").parse;
var re = /var\s+([a-zA-Z_]\w*);/ ;


var parse = require("regulex").parse;
var visualize = require("regulex").visualize;
var Raphael = require('regulex').Raphael;
var re = /var\s+([a-zA-Z_]\w*);/;
var paper = Raphael("yourSvgContainerId", 0, 0);
try {
  visualize(parse(re.source), getRegexFlags(re), paper);
} catch(e) {
  if (e instanceof parse.RegexSyntaxError) {
    logError(re, e);
  } else {
    throw e;

function logError(re, err) { var msg = ["Error:" + err.message, ""]; if (typeof err.lastIndex === "number") { msg.push(re); msg.push(new Array(err.lastIndex).join("-") + "^"); } console.log(msg.join("\n")); }

function getRegexFlags(re) { var flags = ""; flags += re.ignoreCase ? "i" : ""; flags += ? "g" : ""; flags += re.multiline ? "m" : ""; return flags; }

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.