python cffi bindings for the oniguruma regex engine
Project description
onigurumacffi
python cffi bindings for the oniguruma regex engine
installation
pip install onigurumacffi
- manylinux 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.13-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96d6b3cc65d6a5063a1039e5a564023774e310d4f08c45a7ca49f314e9b425e4 |
|
MD5 | 37631251b57e477e628856d326703c6d |
|
BLAKE2b-256 | 108881b56e4f54aac3c89d8605b44c5494434eb4d1eff4534d3f7e3fd84832ee |
Hashes for onigurumacffi-0.0.13-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 955145f8e2566ce6b9f519c2cee90ddcd93c3e9c43413c9544972f24c59cabbe |
|
MD5 | 9f929448b014ecde21f05e6d11a55b5c |
|
BLAKE2b-256 | 9ae4716df49e4465b5bb8fa3ec6153c60489a5d98b2ab04d276d98ee245f003d |
Hashes for onigurumacffi-0.0.13-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cb19b2136931011351a3429fe462a9cd0495014aee43beabf3ae71bf6edf109 |
|
MD5 | 2b5d54003a06d7d7bef454904a4e8a40 |
|
BLAKE2b-256 | b1be5f8e860b6f28f56c5b7a78c638ce02d08429da1f4fa7e009bd787dc8c671 |
Hashes for onigurumacffi-0.0.13-cp36-abi3-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aedb84b07fa537c9b15163d4b6b4c92e091e2f7e351b2b11570f1f183340612 |
|
MD5 | 91abba47deb207c4fc594481bd9718d8 |
|
BLAKE2b-256 | 3a9354feb570ccf87d5be7255faf95bd47d135354999efca5145a164ae22680a |
Hashes for onigurumacffi-0.0.13-cp36-abi3-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24c0582b24b1c74787ae8e939a59dfd4579d43e7ea28aaf670048b144beace55 |
|
MD5 | c3a87faf4b10b9c279193174604b8b20 |
|
BLAKE2b-256 | 5cd86c4ea0a1af9abeef1315db41afac97fd695665020f9b40979e79ce549373 |