All Projects → jserv → cregex

jserv / cregex

Licence: BSD-2-Clause license
A small implementation of regular expression matching engine in C

Programming Languages

c
50402 projects - #5 most used programming language
ruby
36898 projects - #4 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to cregex

Regulex
🚧 Regular Expression Excited!
Stars: ✭ 4,877 (+6673.61%)
Mutual labels:  regex, regexp, regular-expression
Regex For Regular Folk
🔍💪 Regular Expressions for Regular Folk — A visual, example-based introduction to RegEx [BETA]
Stars: ✭ 242 (+236.11%)
Mutual labels:  regex, regexp, regular-expression
Onigmo
Onigmo is a regular expressions library forked from Oniguruma.
Stars: ✭ 536 (+644.44%)
Mutual labels:  regex, regexp, regular-expression
Regexpu
A source code transpiler that enables the use of ES2015 Unicode regular expressions in ES5.
Stars: ✭ 201 (+179.17%)
Mutual labels:  regex, regexp, regular-expression
Regex Dos
👮 👊 RegEx Denial of Service (ReDos) Scanner
Stars: ✭ 143 (+98.61%)
Mutual labels:  regex, regexp, regular-expression
Regexp2
A full-featured regex engine in pure Go based on the .NET engine
Stars: ✭ 389 (+440.28%)
Mutual labels:  regex, regexp, regular-expression
Regexr
For composing regular expressions without the need for double-escaping inside strings.
Stars: ✭ 53 (-26.39%)
Mutual labels:  regex, regexp, regular-expression
expand-brackets
Expand POSIX bracket expressions (character classes) in glob patterns.
Stars: ✭ 26 (-63.89%)
Mutual labels:  regex, regexp, regular-expression
Orchestra
One language to be RegExp's Successor. Visually readable and rich, technically safe and extended, naturally scalable, advanced, and optimized
Stars: ✭ 103 (+43.06%)
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 (-8.33%)
Mutual labels:  regex, regexp, regular-expression
Rex
Your RegEx companion.
Stars: ✭ 283 (+293.06%)
Mutual labels:  regex, regexp, regular-expression
moar
Deterministic Regular Expressions with Backreferences
Stars: ✭ 19 (-73.61%)
Mutual labels:  regex, regexp, regular-expression
RgxGen
Regex: generate matching and non matching strings based on regex pattern.
Stars: ✭ 45 (-37.5%)
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 (+445.83%)
Mutual labels:  regex, regexp, regular-expression
globrex
Glob to regular expression with support for extended globs.
Stars: ✭ 52 (-27.78%)
Mutual labels:  regex, regexp, regular-expression
Commonregex
🍫 A collection of common regular expressions for Go
Stars: ✭ 733 (+918.06%)
Mutual labels:  regex, regexp, regular-expression
regexp-expand
Show the ELisp regular expression at point in rx form.
Stars: ✭ 18 (-75%)
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 (+1475%)
Mutual labels:  regex, regexp, regular-expression
Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+6631.94%)
Mutual labels:  regex, regexp, regular-expression
Regaxor
A regular expression fuzzer.
Stars: ✭ 35 (-51.39%)
Mutual labels:  regex, regexp, regular-expression

cregex

cregex is a compact implementation of regular expression (regex) matching engine in C. Its design was inspired by Rob Pike's regex-code for the book "Beautiful Code" available online here. It is based on two papers by Russ Cox:

cregex supports a subset of the syntax and semantics of the POSIX Basic Regular Expressions. The main design goal of cregex is to be small, correct, self contained and use few resources while retaining acceptable performance and feature completeness.

Features

  • ^ and $ anchors
  • . match any single character
  • [...] and [^...] character classes
  • ?, *, +, and {x,y} greedy quantifiers
  • ??, *?, +?, and {x,y}? non-greedy quantifiers
  • (...) capturing groups

Build and Test

Simply run to build the library and test programs.

$ make

Run the tests from Go distribution.

$ make check

Visualize the regular expressions with Graphviz.

$ tests/re2dot "(a*)(b{0,1})(b{1,})b{3}" | dot -Tpng -o out.png

License

cregex is freely redistributable under the BSD 2 clause license. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

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].