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.12-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 817b36fc7d341b428ab2e8b9984748898cfb67785d05ec82884bfc846b048f6c |
|
MD5 | fe38e0072ffeb1f9af13e9e9a0467165 |
|
BLAKE2b-256 | 36e2ba43ae08455f31a55597bb8e6f82e418195c98eb781226fff3f13c644638 |
Hashes for onigurumacffi-0.0.12-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d68fa3e170f7599c3974d2039c2854f9efd32dae60e541a7a32b8eee619362e |
|
MD5 | 6c3d8930279f76ca687ee286d97f0c0c |
|
BLAKE2b-256 | 63aa47fcebe53ce0528a07adc7f1b70bae6dfe91e16604815170c78c88b2a8bc |
Hashes for onigurumacffi-0.0.12-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d66b090e592185587947a7405e16d2d185f263b911cd4d3d68904c8662a3df8 |
|
MD5 | 66767ccf6b87c428d363d2f01d4fd027 |
|
BLAKE2b-256 | 0103b54c6a2139b5702c3e762a7b61f382901eb02d84b97ebe5cd88deaef1da0 |
Hashes for onigurumacffi-0.0.12-cp36-abi3-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64ea0c3143b16c57b93fb182a0de4ffa9aa84ddbe2c6be304840c873d36771a3 |
|
MD5 | 888c7ef0ac7486fe0468be609d65465c |
|
BLAKE2b-256 | eea5ad1789d60cec77528b77d0d9d75c8a254fd50ba6104782399cea6a79be14 |
Hashes for onigurumacffi-0.0.12-cp36-abi3-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ff7544718174aa3985980d76c77d96c18ce8682174d0e569c228f3d6bd515e9 |
|
MD5 | d1dd1aad793420eab79850b998f31206 |
|
BLAKE2b-256 | 84b8fd232ea87a60b5fb3acf0a53aeefc9072f1ca016b29e6047aecf38d4196e |