Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Maker Regular Expressions

Project description

Maker Regular Expression

PyPI

This is a simple package to make regular expressions in Python.

pip install mre

Documentation:

Examples

from mre import Regex, Group

rgx_one = Regex("Hello world")  # Hello world
rgx_two = Regex("Hello", " world")  # Hello world
rgx_three = Regex("Hello") + " " + Regex("world")  # Hello world
rgx_four = Regex('<', Group('h[1-6]'), '>')  # <(h[1-6])>
rgx_five = Regex('<', Regex.SLASH, 1, '>')  # <\/\1>
from mre import Regex, Set

# All digits
digits = Set(Regex("0-9"))

rgx_cep = Regex(
    digits.quantifier(5),
    Regex("-").quantifier(0, 1),
    digits.quantifier(3),
)

# Output: [0-9]{5}-?[0-9]{3}

Contributing documentation

pip install -r requirements-dev.txt

Running documentation

mkdocs serve

Change or create files in the docs folder.

Project details


Download files

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

Files for mre, version 0.10.0
Filename, size File type Python version Upload date Hashes
Filename, size mre-0.10.0-py3-none-any.whl (11.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page