exrex
reverse regex matching string generator
TLDR
SYNOPSIS
exrex [options] regex
DESCRIPTION
exrex is a command-line tool and Python library that generates all or random strings matching a given regular expression. It's useful for testing, fuzzing, and generating sample data.The tool parses regex patterns and produces strings that would match, rather than matching existing strings. It supports most common regex features including character classes, quantifiers, groups, and alternation.exrex is particularly useful for generating test inputs, creating wordlists, or understanding what patterns a regex would match.
PARAMETERS
REGEX
Regular expression pattern to generate strings from.-r, --random
Return a single random string that matches the regex.-c, --count
Print the number of matching strings instead of the strings.-l N, --limit N
Maximum range size for unbounded quantifiers (+, *). Default is 20.-m N, --max-number N
Maximum number of strings to generate. Default is -1 (all).-o FILE, --output FILE
Write output to FILE instead of standard output.-d DELIM, --delimiter DELIM
Output delimiter (default newline).-s, --simplify
Simplify the regular expression.-v, --verbose
Verbose mode.--help
Display help information.
CAVEATS
Unlimited quantifiers (*, +) are bounded by default. Complex patterns may generate massive output. Not all regex features supported. Memory usage scales with output size.
HISTORY
exrex is a Python-based regex string generator created for testing and security research, providing reverse regex matching capabilities for generating test data and wordlists.