No project description provided
Project description
exrex_variant_generator
exrex_variant_generator is a Python package that leverages regular expressions to generate all possible string variants. It can handle standard regex patterns by expanding them into all matching strings, or it can interpret custom string formats with bracketed options to generate combinations.
Installation
To install exrex_variant_generator, use pip:
pip install exrex_variant_generator
Usage
Using exrex_variant_generator is straightforward.
Generating variants from a custom string with options:
This mode interprets strings like 'a[bc]d' to generate combinations.
from exrex_variant_generator import generate_variants
custom_pattern = 'user[123]_pref[a|b]'
variants = generate_variants(custom_pattern)
print(variants)
# Output: ['user1_prefa', 'user1_pref b', 'user2_prefa', 'user2_pref b', 'user3_prefa', 'user3_pref b']
Generating variants from a strict regex pattern:
This mode uses the exrex library to generate all strings matching a given regex.
from exrex_variant_generator import generate_variants
regex_pattern = '[a-c]{2}'
variants = generate_variants(regex_pattern)
print(variants)
# Output: ['aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca', 'cb', 'cc']
Author
- Eugene Evstafev hi@eugene.plus - LinkedIn
Repository
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
License
exrex_variant_generator is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file exrex_variant_generator-2025.9.142053.tar.gz.
File metadata
- Download URL: exrex_variant_generator-2025.9.142053.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac724fa1774b7dc6c511c632bf1cce93cc1dc971d57ec08d3e187336e450cd7d
|
|
| MD5 |
584055b1e661fd2b9b6bcdc96c1c132c
|
|
| BLAKE2b-256 |
75af2d6d51d6468a51c8eb2882724c86b682285ca2e87064b8f308740dff220d
|
File details
Details for the file exrex_variant_generator-2025.9.142053-py3-none-any.whl.
File metadata
- Download URL: exrex_variant_generator-2025.9.142053-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43850e7c1df4d5c2429cbc36e22d393e796a24b00c6ed055830b32b72ba6c38f
|
|
| MD5 |
e201849decf75d23448a54fc62d485e8
|
|
| BLAKE2b-256 |
9927862ab4a1e933fd88742a91aa41017ce4b7a9b47693b76841ea64e8bf71b6
|