Skip to main content

PyPI version License: MIT Downloads LinkedIn

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

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.

Metadata

Release files for exrex-variant-generator 2025.9.142053

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exrex-variant-generator 2025.9.142053
File Size Uploaded
exrex_variant_generator-2025.9.142053.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for exrex-variant-generator 2025.9.142053
File Interpreter ABI Platform
exrex_variant_generator-2025.9.142053-py3-none-any.whl Python 3 none any Details

Total release size: 6.0 kB

Release files / exrex_variant_generator-2025.9.142053.tar.gz

Download URL exrex_variant_generator-2025.9.142053.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ac724fa1774b7dc6c511c632bf1cce93cc1dc971d57ec08d3e187336e450cd7d
BLAKE2b-256 checksum
How to use checksums
75af2d6d51d6468a51c8eb2882724c86b682285ca2e87064b8f308740dff220d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / exrex_variant_generator-2025.9.142053-py3-none-any.whl

Download URL exrex_variant_generator-2025.9.142053-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43850e7c1df4d5c2429cbc36e22d393e796a24b00c6ed055830b32b72ba6c38f
BLAKE2b-256 checksum
How to use checksums
9927862ab4a1e933fd88742a91aa41017ce4b7a9b47693b76841ea64e8bf71b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

2025.9.142053 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page