Skip to main content

A functional wrapper for RegEx in Python.

Project description

RegexBuilder: A functional wrapper for RegEx in Python.

Installation

python -m pip install regexbuilder-py
# or
python -m pip install git+https://github.com/AaravMalani/regexbuilder

Usage

print(RegEx().start() \
       .string('http') \
       .chars('s').modify(Modifiers.ZERO_OR_ONE) \
       .string('://') \
       .group(RegEx() 
              .chars('a-zA-Z0-9') \
              .modify(Modifiers.ONE_OR_MORE) \
              .chars(r'.')) \
       .modify(Modifiers.ZERO_OR_MORE) \
       .chars('A-Za-z0-9').modify(Modifiers.ONE_OR_MORE) \
       .chars('.') \
       .chars('A-Za-z').modify(Modifiers.ONE_OR_MORE) \
       .group(RegEx().string('.')).build())
# $(?:http)[s]?(?:://)([a-zA-Z0-9]+[.])*[A-Za-z0-9]+[.][A-Za-z]+((?:.))

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

regexbuilder-py-1.0.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

regexbuilder_py-1.0.0-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

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