Skip to main content

Magic Regex

Project description

Magic Regex

Read and write regular expressions easily.

import mrex

# Find
id_re = mrex.exactly("id: ").and_(mrex.DIGITS.group_as("id"))
id_str = id_re.find("id: 12345").group("id")
# id_str == "12345"

# Split
words = mrex.NON_CHARS.split("It's just a flesh wound...")
# words == ["It", "s", "just", "a", "flesh", "wound", ""]

Installation

pip install mrex

Development

  • Download source
  • Install development dependencies: flit install -s --deps develop
  • Format code: black .
  • Run tests: pytest
  • Bump version in src/mrex/__init__.py
  • Build package: flit build
  • Deploy: flit publish

Thanks

Project influenced by magic-regexp.

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

mrex-0.0.4.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

mrex-0.0.4-py3-none-any.whl (3.7 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