Linux command
exrex 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Generate strings from
exrex '[a-z]{3}'
Generate all matches
exrex -a '[0-9]{2}'
Limit output count
exrex -c [10] '[a-z]+'
Random generation
exrex -r '[A-Za-z0-9]{8}'
Print match count
exrex -n '[a-z]{2}'
说明
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.
参数
- -a, --all
- Generate all possible matching strings.
- -c _N_, --count _N_
- Limit output to N strings.
- -r, --random
- Generate random matching string.
- -n, --num
- Print count of possible matches.
- -d _DELIM_, --delimiter _DELIM_
- Output delimiter (default newline).
- --help
- Display help information.
FAQ
What is the exrex command used for?
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.
How do I run a basic exrex example?
Run `exrex '[a-z]{3}'` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --all do in exrex?
Generate all possible matching strings.