All Projects → nilium → Regen

nilium / Regen

Licence: bsd-2-clause
Tool to generate random strings from Go/RE2 regular expressions (Migrated to https://git.sr.ht/~nilium/regen)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Regen

Regexr
For composing regular expressions without the need for double-escaping inside strings.
Stars: ✭ 53 (-32.91%)
Mutual labels:  regular-expression, regexp
Hyperscan Java
Match tens of thousands of regular expressions within milliseconds - Java bindings for Intel's hyperscan 5
Stars: ✭ 66 (-16.46%)
Mutual labels:  regular-expression, regexp
expand-brackets
Expand POSIX bracket expressions (character classes) in glob patterns.
Stars: ✭ 26 (-67.09%)
Mutual labels:  regexp, regular-expression
cregex
A small implementation of regular expression matching engine in C
Stars: ✭ 72 (-8.86%)
Mutual labels:  regexp, regular-expression
Emoji Regex
A regular expression to match all Emoji-only symbols as per the Unicode Standard.
Stars: ✭ 1,134 (+1335.44%)
Mutual labels:  regular-expression, regexp
path-to-regexp-php
PHP port of https://github.com/pillarjs/path-to-regexp
Stars: ✭ 21 (-73.42%)
Mutual labels:  regexp, regular-expression
RgxGen
Regex: generate matching and non matching strings based on regex pattern.
Stars: ✭ 45 (-43.04%)
Mutual labels:  regexp, regular-expression
String Replace Loader
Replace loader for Webpack
Stars: ✭ 205 (+159.49%)
Mutual labels:  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 (+397.47%)
Mutual labels:  regular-expression, regexp
Regexp2
A full-featured regex engine in pure Go based on the .NET engine
Stars: ✭ 389 (+392.41%)
Mutual labels:  regular-expression, regexp
Regaxor
A regular expression fuzzer.
Stars: ✭ 35 (-55.7%)
Mutual labels:  regexp, regular-expression
Onigmo
Onigmo is a regular expressions library forked from Oniguruma.
Stars: ✭ 536 (+578.48%)
Mutual labels:  regular-expression, regexp
moar
Deterministic Regular Expressions with Backreferences
Stars: ✭ 19 (-75.95%)
Mutual labels:  regexp, regular-expression
regexp-expand
Show the ELisp regular expression at point in rx form.
Stars: ✭ 18 (-77.22%)
Mutual labels:  regexp, regular-expression
Regex For Regular Folk
🔍💪 Regular Expressions for Regular Folk — A visual, example-based introduction to RegEx [BETA]
Stars: ✭ 242 (+206.33%)
Mutual labels:  regular-expression, regexp
globrex
Glob to regular expression with support for extended globs.
Stars: ✭ 52 (-34.18%)
Mutual labels:  regexp, regular-expression
Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+6035.44%)
Mutual labels:  regular-expression, regexp
Regexpu
A source code transpiler that enables the use of ES2015 Unicode regular expressions in ES5.
Stars: ✭ 201 (+154.43%)
Mutual labels:  regular-expression, regexp
Rex
Your RegEx companion.
Stars: ✭ 283 (+258.23%)
Mutual labels:  regular-expression, regexp
Regulex
🚧 Regular Expression Excited!
Stars: ✭ 4,877 (+6073.42%)
Mutual labels:  regular-expression, regexp

regen

$ go get go.spiff.io/regen

regen is a small tool to generate more or less random strings from Go RE2 regular expressions. You can read up on RE2 at https://github.com/google/re2/wiki/Syntax.

As a few examples:

$ regen -n 2 '0x[\da-f]{16}'
0x8f5858102a5ce124
0x3e4c9fee6c9f419d

$ regen -n 3 '[a-z]{6,12}(\+[a-z]{6,12})[email protected][a-z]{6,16}(\.[a-z]{2,3}){1,2}'
[email protected]
[email protected]
[email protected]

Essentially, all regen does is parse the regular expressions it's given and iterate over the tree produced by regexp/syntax and attempt to generate strings based on the ops described by its results. This could probably be optimized further by compiling the resulting Regexp into a Prog, but I didn't feel like this was worthwhile when it's a very small tool.

Currently, handling word boundaries is not supported and will cause regen to panic in response. The way line endings and EOT is handled are also likely incorrect and they'll need some more thinking put into them.

Some additional information can be found at https://godoc.org/go.spiff.io/regen.

Contributing

Currently, development of regen is happening over at https://git.spiff.io. If you'd like to submit a patch, please first open an issue on GitHub to discuss what you'd like to do and we can go from there. regen does not currently accept pull requests because changes are replicated from Gerrit to GitHub, but not vice versa.

License

regen is licensed under a 2-clause BSD license. This can be found in LICENSE.txt.

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