Skip to main content

Rejex

Rejex is a tool used to build regex expressions for python.

A library which can help in building regex expressions which can be used with regex libraries(such as "re") to parse strings.



Changelogs

Changelogs



Usage

import rejex
from rejex import Rejex, Static

rejex_test = (
        Rejex()
            .zero_or_one(
                Rejex()
                    .literal("+")
                    .one_or_more(
                        Static.any_number()
                    )
                    .compile()
            )
            .zero_or_one(Static.literal(" "))
            .zero_or_one(Static.literal("("))
            .n_number_times(3, Static.any_number())
            .zero_or_one(Static.literal(")"))
            .zero_or_one(Static.literal(" "))
            .n_number_times(3, Static.any_number())
            .zero_or_one(Static.alternative(Static.literal("-"), Static.literal(" ")))
            .n_number_times(4, Static.any_number())
        .compile()
    )

rejex.test_regex(rejex_test, "+1 (123) 123 4567") #True
"""
-------------------------------
regex_pattern='(\+(\d)+)? ?(\()?(\d){3}(\))? ?(\d){3}((-| ))?(\d){4}'
string='+1 (123) 123 4567'
match=True
-------------------------------
"""

Uses



Metadata

Release files for rejex 0.0.1.1

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

Source distribution (sdist)

Source distribution for rejex 0.0.1.1
File Size Uploaded
rejex-0.0.1.1.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rejex 0.0.1.1
File Interpreter ABI Platform
rejex-0.0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / rejex-0.0.1.1.tar.gz

Download URL rejex-0.0.1.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
07f783801c80fbd489038e141388a91138915afe75b2db29fb56de9c843c57ce
BLAKE2b-256 checksum
How to use checksums
42c79ea50e3a12b109ac27f594d24e1eb6e3bdf4b7f6132318cd5b6d6291055f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.10.0

Release files / rejex-0.0.1.1-py3-none-any.whl

Download URL rejex-0.0.1.1-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92e8f7f38be28b96e98c21ee21653fd09f623a8cc64cae34644b39b8a7ddb91d
BLAKE2b-256 checksum
How to use checksums
83e22481e97e8d5c5ada3da603f5419336f3dbcc71d476a91bae5cdfbe245113
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.10.0

Release history Release notifications | RSS feed

This release

0.0.1.1 This release

2 release files

0.0.1

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