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.14-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f105793c14e3169c053e7d7f96fc60ef0570a0bea0421a7d4e91863f8cbfa5d7 |
|
MD5 | 50335b0a23417ee9d9dbfec6462aaee8 |
|
BLAKE2b-256 | c90268c1777413daebe44358c2eb8d4883b0741d38e94ddbb33a3021d05f6791 |
Hashes for onigurumacffi-0.0.14-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4bfc47266672715ed31da3ac7f66443c733093a76f9a6ba711ac39462414e13 |
|
MD5 | 078627445a7f825d4b710a0266cf78ba |
|
BLAKE2b-256 | 19f31dd60fb6d541b68f88ee50b4e31958e00fd27d4a06b50dc6d178bcc7bc51 |
Hashes for onigurumacffi-0.0.14-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e9e5af201b7d025818705c880e71171f61d0354c9ce950462d3e2cd3f70828d |
|
MD5 | add356bbc44f07c81851b12e04b561fd |
|
BLAKE2b-256 | 9bf6c2aa0ab9282bda0c18bd1fca6fbeb09d9ab9093c4e6a9a1e665bb2899afe |
Hashes for onigurumacffi-0.0.14-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed23499f8f12358da6e66a10af3533658d874448e0ccf201fae0c9176d371059 |
|
MD5 | 19aabf547a4a1752b9628c18357e9843 |
|
BLAKE2b-256 | 8aae5c6c99720ef97317078dc16501d565019c900d7d93c39e490e7bc9a7f0a3 |
Hashes for onigurumacffi-0.0.14-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdf3f71a15329a12d17d6d4500b6654e24a499160c5c4151c6f452b98447d080 |
|
MD5 | 3bc1d26fe68bdcdea9866e7f5bbf1e14 |
|
BLAKE2b-256 | cd39f5883f3409381b0391b38f7cc2e697015c14f6bd32e4d04c983c05926b03 |
Hashes for onigurumacffi-0.0.14-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1829541fe2e926372f1fa4d81042c173bcdcfef7aed059c341ce9d2e6a7fa4c |
|
MD5 | 8fbf148bfaead0edb3d3d82087272c8e |
|
BLAKE2b-256 | 71416ba291625f71c40d1ba4c259907de505b5cce434ec25015242cb5899ba6c |
Hashes for onigurumacffi-0.0.14-cp36-abi3-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28339fc477e545f87bd67096f1ba230bb90a1f6d8f2c65270e125e046b7b8e2d |
|
MD5 | 99bd8b0c17af2e393a08e5fbf1d11f0a |
|
BLAKE2b-256 | 09eb2e801f063b2ca72f8e376fe7846cdc2bca4662c8eccd3d1577a6f4346c1d |
Hashes for onigurumacffi-0.0.14-cp36-abi3-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa1cf24299b8cb337e1bf44a80e2454102fcc8e40fdd27efb461e4813d4b9f11 |
|
MD5 | 9d06c743843f6bd5e69fe0038a42bc03 |
|
BLAKE2b-256 | 85ac7af524187055c66b68f94085a56a5e2c0fc53a81b710196f311450c8d21e |