Skip to main content

No project description provided

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exrex_variant_generator-2025.9.142053.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file exrex_variant_generator-2025.9.142053.tar.gz.

File metadata

File hashes

Hashes for exrex_variant_generator-2025.9.142053.tar.gz
Algorithm Hash digest
SHA256 ac724fa1774b7dc6c511c632bf1cce93cc1dc971d57ec08d3e187336e450cd7d
MD5 584055b1e661fd2b9b6bcdc96c1c132c
BLAKE2b-256 75af2d6d51d6468a51c8eb2882724c86b682285ca2e87064b8f308740dff220d

See more details on using hashes here.

File details

Details for the file exrex_variant_generator-2025.9.142053-py3-none-any.whl.

File metadata

File hashes

Hashes for exrex_variant_generator-2025.9.142053-py3-none-any.whl
Algorithm Hash digest
SHA256 43850e7c1df4d5c2429cbc36e22d393e796a24b00c6ed055830b32b72ba6c38f
MD5 e201849decf75d23448a54fc62d485e8
BLAKE2b-256 9927862ab4a1e933fd88742a91aa41017ce4b7a9b47693b76841ea64e8bf71b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page