All Projects → moar-regex → moar

moar-regex / moar

Licence: MIT license
Deterministic Regular Expressions with Backreferences

Programming Languages

java
68154 projects - #9 most used programming language
TeX
3793 projects
ANTLR
299 projects

Projects that are alternatives of or similar to moar

RgxGen
Regex: generate matching and non matching strings based on regex pattern.
Stars: ✭ 45 (+136.84%)
Mutual labels:  regex, regexp, regular-expression, regex-pattern, regular-expressions
Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+25410.53%)
Mutual labels:  regex, regexp, regular-expression, regex-pattern, regular-expressions
Regex
An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.
Stars: ✭ 2,125 (+11084.21%)
Mutual labels:  regex, regexp, regular-expressions, regex-engine
Regex For Regular Folk
🔍💪 Regular Expressions for Regular Folk — A visual, example-based introduction to RegEx [BETA]
Stars: ✭ 242 (+1173.68%)
Mutual labels:  regex, regexp, regular-expression, regular-expressions
Rex
Your RegEx companion.
Stars: ✭ 283 (+1389.47%)
Mutual labels:  regex, regexp, regular-expression
Regex Dos
👮 👊 RegEx Denial of Service (ReDos) Scanner
Stars: ✭ 143 (+652.63%)
Mutual labels:  regex, regexp, regular-expression
regex-comuns
Um estudo de regex comuns
Stars: ✭ 15 (-21.05%)
Mutual labels:  regex, regular-expression, regex-pattern
Onigmo
Onigmo is a regular expressions library forked from Oniguruma.
Stars: ✭ 536 (+2721.05%)
Mutual labels:  regex, regexp, regular-expression
Re Flex
The regex-centric, fast lexical analyzer generator for C++ with full Unicode support. Faster than Flex. Accepts Flex specifications. Generates reusable source code that is easy to understand. Introduces indent/dedent anchors, lazy quantifiers, functions for lex/syntax error reporting, and more. Seamlessly integrates with Bison and other parsers.
Stars: ✭ 274 (+1342.11%)
Mutual labels:  regex, regular-expression, regular-expressions
Regulex
🚧 Regular Expression Excited!
Stars: ✭ 4,877 (+25568.42%)
Mutual labels:  regex, regexp, regular-expression
Commonregex
🍫 A collection of common regular expressions for Go
Stars: ✭ 733 (+3757.89%)
Mutual labels:  regex, regexp, regular-expression
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 (+1968.42%)
Mutual labels:  regex, regexp, regular-expression
Regexp2
A full-featured regex engine in pure Go based on the .NET engine
Stars: ✭ 389 (+1947.37%)
Mutual labels:  regex, regexp, regular-expression
Regexpu
A source code transpiler that enables the use of ES2015 Unicode regular expressions in ES5.
Stars: ✭ 201 (+957.89%)
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 (+5868.42%)
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 (+247.37%)
Mutual labels:  regex, regexp, regular-expression
librxvm
non-backtracking NFA-based regular expression library, for C and Python
Stars: ✭ 57 (+200%)
Mutual labels:  regex, regexp, regex-pattern
Orchestra
One language to be RegExp's Successor. Visually readable and rich, technically safe and extended, naturally scalable, advanced, and optimized
Stars: ✭ 103 (+442.11%)
Mutual labels:  regex, regexp, regular-expression
Regexr
For composing regular expressions without the need for double-escaping inside strings.
Stars: ✭ 53 (+178.95%)
Mutual labels:  regex, regexp, regular-expression
Youtube Regex
Best YouTube Video ID regex. Online: https://regex101.com/r/rN1qR5/2 and http://regexr.com/3anm9
Stars: ✭ 87 (+357.89%)
Mutual labels:  regex, regexp, regular-expressions

moar

Deterministic Regular Expressions with Backreferences. Uses Memory Occurrence Automata to match the input.

ANTLR is used for Pattern compilation.

Why?

Java's Patterns are not deterministic and might get you into trouble. All deterministic alternatives don't support backreferences. This library does. This however is no drop in replacement for Java's patterns as some things can not be expressed while keeping the determinism.

Technical documentation

The technical documentation can be found in the documentation folder.

Theoretical Background

I held a talk at university covering the basics of this library as well. It can be found in the presentation folder.

A Paper explaining the theoretical background can be found here.

Supported Syntax

While somewhat similar to Java's Pattern syntax, moar's supported syntax might differ in some cases. The full supported Pattern syntax can easily be seen in the ANTLR grammar:

Examples

MoaPattern pattern = MoaPattern.compile("^Deterministic|OrNot$");
MoaMatcher matcher = pattern.matcher("Deterministic");
if ( matcher.matches() ) {
  System.out.println("yay");
}

Or this cool language:

MoaPattern pattern = MoaPattern.compile("((?<y>\\k<x>)(?<x>\\k<y>a))+");
MoaMatcher matcher = pattern.matcher("aaaa");
if( matcher.matches() ) {
  System.out.println("yay again.");
}
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].