Regex with structural pattern matching
Project description
pregex
Usage
from pregex import * pattern = Pattern(["The code is:", Kleene([Require(Raw("[0-9]+"), name="code", post=int), Optional(",")])]) message = "The code is: 123456, 3456" res = match_rawstring(pattern, message, RegexFlag.SPLIT) res.group("code")
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
pregex-0.3.2.tar.gz
(5.0 kB
view hashes)
Built Distribution
pregex-0.3.2-py3-none-any.whl
(5.1 kB
view hashes)