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 details)

Uploaded Source

Built Distribution

mrex-0.0.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file mrex-0.0.4.tar.gz.

File metadata

  • Download URL: mrex-0.0.4.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for mrex-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1781339901a0b532f042e99f851ed8ee8d439045e316ca241ea8ecab53593d58
MD5 7497e2dfed2bfc9d0bc67e1d739d39c9
BLAKE2b-256 370a6ac60185d4e3b42c935c087864bb41d696e225f2265054f833a637b3f847

See more details on using hashes here.

File details

Details for the file mrex-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: mrex-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for mrex-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2c448e0a23399685960b83cea4c7b90f1cb3d32afb508cbba46dd966d1ffcd57
MD5 1b963611877a142d1569a9b100ffadb4
BLAKE2b-256 7a769f432316daa1b6c07078ab1508969292af55b877b83b70033fbf3e309908

See more details on using hashes here.

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