Working with RegEx made easy!
Project description
remagic
Working with regex made easier!
Partly inspired from magic-regexp for Node
from remagic import *
pattern1 = create(DIGIT) # matches any digit
pattern2 = char_in("aeiou") # matches any char in "aeiou"
pattern3 = ~pattern2 # negates the pattern in pattern2,
# i.e. match everything except characters in "aeiou"
# Note: remagic 0.1.1 doesn't support the ~ syntax
# use char_not_in("aeiou") instead
pattern4 = pattern1 + pattern3
# finally compile, use standard flags as optional argument
R = pattern4.compile()
# use the regex later
Installation
Install from PyPI:
pip install remagic
Work in Progress!
Documentation
TODO: docs
Known bugs
- improper behaviour with
any_of
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
remagic-0.1.2a0.tar.gz
(6.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file remagic-0.1.2a0.tar.gz.
File metadata
- Download URL: remagic-0.1.2a0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.11.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
126899aee534bcf7d674ba784ae808573d1ed6fbb84a06fb3b591b313f04b676
|
|
| MD5 |
732a8ee9841b59c77486e1087396705d
|
|
| BLAKE2b-256 |
76933ddab57c4332889de0a335815f1a21e6490ada86dd67e76db7575e269fa4
|
File details
Details for the file remagic-0.1.2a0-py3-none-any.whl.
File metadata
- Download URL: remagic-0.1.2a0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.11.0 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd4039feb8aca13abe420754c4f45494b9df316c8cc73540e41e75ffdd0164ca
|
|
| MD5 |
5de78971df787ff94eb17343e5a889eb
|
|
| BLAKE2b-256 |
10fafc03a5e91658bf593bdc80eb1afe0cbfb507829c89610cadd36a68095ca2
|