All Projects → CJex → Regulex

CJex / Regulex

Licence: mit
🚧 Regular Expression Excited!

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to Regulex

Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (-0.62%)
Mutual labels:  regex, regular-expression, regexp
moar
Deterministic Regular Expressions with Backreferences
Stars: ✭ 19 (-99.61%)
Mutual labels:  regex, regexp, regular-expression
Regexpu
A source code transpiler that enables the use of ES2015 Unicode regular expressions in ES5.
Stars: ✭ 201 (-95.88%)
Mutual labels:  regex, regular-expression, regexp
Picomatch
Blazing fast and accurate glob matcher written JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.
Stars: ✭ 393 (-91.94%)
Mutual labels:  regex, regular-expression, regexp
Rex
Your RegEx companion.
Stars: ✭ 283 (-94.2%)
Mutual labels:  regex, regular-expression, regexp
Orchestra
One language to be RegExp's Successor. Visually readable and rich, technically safe and extended, naturally scalable, advanced, and optimized
Stars: ✭ 103 (-97.89%)
Mutual labels:  regex, regular-expression, regexp
Regexp2
A full-featured regex engine in pure Go based on the .NET engine
Stars: ✭ 389 (-92.02%)
Mutual labels:  regex, regular-expression, regexp
Commonregex
🍫 A collection of common regular expressions for Go
Stars: ✭ 733 (-84.97%)
Mutual labels:  regex, regular-expression, regexp
regexp-expand
Show the ELisp regular expression at point in rx form.
Stars: ✭ 18 (-99.63%)
Mutual labels:  regex, regexp, regular-expression
cregex
A small implementation of regular expression matching engine in C
Stars: ✭ 72 (-98.52%)
Mutual labels:  regex, regexp, regular-expression
Hyperscan Java
Match tens of thousands of regular expressions within milliseconds - Java bindings for Intel's hyperscan 5
Stars: ✭ 66 (-98.65%)
Mutual labels:  regex, regular-expression, regexp
globrex
Glob to regular expression with support for extended globs.
Stars: ✭ 52 (-98.93%)
Mutual labels:  regex, regexp, regular-expression
Emoji Regex
A regular expression to match all Emoji-only symbols as per the Unicode Standard.
Stars: ✭ 1,134 (-76.75%)
Mutual labels:  regex, regular-expression, regexp
Regex Dos
👮 👊 RegEx Denial of Service (ReDos) Scanner
Stars: ✭ 143 (-97.07%)
Mutual labels:  regex, regular-expression, regexp
Regexr
For composing regular expressions without the need for double-escaping inside strings.
Stars: ✭ 53 (-98.91%)
Mutual labels:  regex, regular-expression, regexp
Regex For Regular Folk
🔍💪 Regular Expressions for Regular Folk — A visual, example-based introduction to RegEx [BETA]
Stars: ✭ 242 (-95.04%)
Mutual labels:  regex, regular-expression, regexp
Onigmo
Onigmo is a regular expressions library forked from Oniguruma.
Stars: ✭ 536 (-89.01%)
Mutual labels:  regex, regular-expression, regexp
Regaxor
A regular expression fuzzer.
Stars: ✭ 35 (-99.28%)
Mutual labels:  regex, regexp, regular-expression
expand-brackets
Expand POSIX bracket expressions (character classes) in glob patterns.
Stars: ✭ 26 (-99.47%)
Mutual labels:  regex, regexp, regular-expression
RgxGen
Regex: generate matching and non matching strings based on regex pattern.
Stars: ✭ 45 (-99.08%)
Mutual labels:  regex, regexp, regular-expression

Regulex

Regulex is a JavaScript Regular Expression Parser & Visualizer.

Try it now: https://jex.im/regulex/

This project is under reconstruction!

Features

  • 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. /\1/, /(\1)/, /(a)\2/, or DecimalEscape appears in charset(because in this case it can't be explained as back reference, e.g. /(ab)[\1]/, Regulex will always throw an error.

Install for Node.js

npm install regulex

Local Build for Browser

This command will generate bundle dist/regulex.js for browser side:

git checkout legacy
npm install -g requirejs
r.js -o build-config.js

API

Parse to AST

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

Visualize

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 += re.global ? "g" : "";
  flags += re.multiline ? "m" : "";
  return flags;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].