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)
Built Distribution
mrex-0.0.4-py3-none-any.whl
(3.7 kB
view hashes)