python cffi bindings for the oniguruma regex engine
Project description
onigurumacffi
python cffi bindings for the oniguruma regex engine
installation
pip install onigurumacffi
- wheels should be available on pypi in most cases
- to build from source,
libonig-dev
must be installed prior to installation
api
the api is currently very limited (basically just enough to support what I needed).
compile(pattern: str) -> _Pattern
make a compiled pattern
compile_regset(*patterns: str) -> _RegSet
make a compiled RegSet
_Pattern.match(s: str, start: int = 0) -> Optional[_Match]
match a string using the pattern. optionally set start
to adjust the offset
which is searched from
_Pattern.search(s: str, start: int = 0) -> Optional[_Match]
search a string using the pattern. optionally set start
to adjust the offset
which is searched from
_Pattern.number_of_captures() -> int
return the number of captures in the regex
_RegSet.search(s: str, start: int = 0) -> Tuple[int, Optional[_Match]]
search a string using the RegSet. optionally set start
to adjust the offset
which is searched from
the leftmost regex index and match is returned or (-1, None)
if there is no
match
_Match.group(n: int = 0) -> str
return the string of the matched group, defaults to 0 (the whole match)
_Match[n: int] -> str
a shorthand alias for _Match.group(...)
_Match.start(n: int = 0) -> int
return the character position of the start of the matched group, defaults to 0 (the whole match)
_Match.end(n: int = 0) -> int
return the character position of the end of the matched group, defaults to 0 (the whole match)
_Match.span(n: int = 0) -> int
return (start, end)
character position of the matched group, defaults to 0
(the whole match)
_Match.expand(s: str) -> str
expand numeric groups in s
via the groups in the match
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
Built Distributions
Hashes for onigurumacffi-0.0.16-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8adea933e3c70d886719e323901fb429ae7c5f1aa7bff5491b9271dee50c5572 |
|
MD5 | ac23ac27bc5ef0a5f07fc835ac795526 |
|
BLAKE2b-256 | f4286720f3958aef49cc78ce3c6357281877d64b9f059e1532a6405bd09a95cd |
Hashes for onigurumacffi-0.0.16-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94bc494a0627d41812e74c0b3d5c706265cd48c4947b1e83319b28f6239944c6 |
|
MD5 | 2801c166d60f2005616f29e411543ae9 |
|
BLAKE2b-256 | a2b5d8825e6aa2d951e407437118625abee0147a3341d63a0b5f01abd8e5e8ea |
Hashes for onigurumacffi-0.0.16-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2baa0e6903cca340b41314a11107f9c30bd0ee8c1c4d0e654bb13c70ebbc8df |
|
MD5 | 9869d445554259beaaed47e8119ca4d1 |
|
BLAKE2b-256 | 8436dd1b5426a4823b9b9d8064f30db920179683dc0cf6cfcc58e6633f43426c |
Hashes for onigurumacffi-0.0.16-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e1c288b9307e498b1d3072821210efceb69741c3769999c725312a09df65446 |
|
MD5 | ab86e319d766553e3f06728ef3986a71 |
|
BLAKE2b-256 | 010c5c98e031843f9d23f65b2a05dc9e08c6cad34c27dfaab5c2948a63d9d864 |
Hashes for onigurumacffi-0.0.16-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e5a9b714ce0c49bd046b4e38ccc0f63e206bd2dfc062d99f4b564602acd25c1 |
|
MD5 | 902d38500d7ba3ad2d5114367b23cd76 |
|
BLAKE2b-256 | 6993d2e6a73faeb4b88864b99aa4e1a714693634a632e43b500dcc86031b07be |
Hashes for onigurumacffi-0.0.16-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1472487f0a992f0e5f8936669d2aef9a306d9ad7a17b06aec61fe19915718bf |
|
MD5 | c65ac1162f3266ebf3fad0f69ea04bf7 |
|
BLAKE2b-256 | ed7098e963ba4418c5061e649d8168c43cf1c1277594d44261fb3d2134805188 |
Hashes for onigurumacffi-0.0.16-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bd2e266f78c2a44e1fed695e9df8cd34d30d7a9370c1ed49dba64f6cbd90aff |
|
MD5 | d03f1a58ac9726c813fc866ea1569c68 |
|
BLAKE2b-256 | 81bc9b371b9303b3b5a27ebe890c8ccef3474037ed52e94198a2b21697189b3f |
Hashes for onigurumacffi-0.0.16-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c76bf3633f64f40353c28d30727faf2d284190efdd9f2e34360303c39ac96d7 |
|
MD5 | 5fcf56cb63ab5b94ecff9035e4ed5b50 |
|
BLAKE2b-256 | e10207102a46af1de59a812ef05ec2f8be0e68f4f153f3a5286edfe68c0e1735 |
Hashes for onigurumacffi-0.0.16-cp36-abi3-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d7651675c3a77df68f35a2370ae7b8b49a420ad23c85494a20e892d15fb5e61 |
|
MD5 | e4bfcbc60530ad5822bf294f0535724a |
|
BLAKE2b-256 | 02b86338620c8e94548d0f36f00540ba6435d3ce1a0f4775da8cd3763cf83756 |
Hashes for onigurumacffi-0.0.16-cp36-abi3-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1aa0782b8edeeeaf62d7559570aeee95fa51f0a58250be094884e7fe92b6194 |
|
MD5 | 6e2e1e7e9174064dcba745327dd0d0c3 |
|
BLAKE2b-256 | 27b977ebd1df5cebb13d84f60b91d9affd79d8c8899a2f2f579252b5afffa246 |