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
File details
Details for the file onigurumacffi-0.0.11.tar.gz
.
File metadata
- Download URL: onigurumacffi-0.0.11.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13f6a41f71fa7409ca65e74c3b20059ca3d05352d7a052e5af39eb68952723a |
|
MD5 | 18f6f66ffe23b74ec662ed5ae7c0f62d |
|
BLAKE2b-256 | 12d3667f8e2df3800b6755620cd42d9014fce4448e53211a2c837ba6656235f6 |
Provenance
File details
Details for the file onigurumacffi-0.0.11-cp36-abi3-manylinux1_x86_64.whl
.
File metadata
- Download URL: onigurumacffi-0.0.11-cp36-abi3-manylinux1_x86_64.whl
- Upload date:
- Size: 528.8 kB
- Tags: CPython 3.6+
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c11b007a7603ebdc3576680b8f597634b36c5e943abf4ff404db1b44802e3487 |
|
MD5 | 55d8d65c9598245f3b398facccf72176 |
|
BLAKE2b-256 | 4649bd73e9bdc7bf7afa74812c24b464934e8f348e7fb12de0cff939f9a7bbd0 |
Provenance
File details
Details for the file onigurumacffi-0.0.11-cp36-abi3-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: onigurumacffi-0.0.11-cp36-abi3-macosx_10_13_x86_64.whl
- Upload date:
- Size: 220.1 kB
- Tags: CPython 3.6+, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed3d7f82054b82e57e9ab8cf930d316af9dfa9e413134b5626f8d568af2df433 |
|
MD5 | f7b20dddc6a0447f85a6aab8ea05e85c |
|
BLAKE2b-256 | c918953d7fa32515a7683d382df84177b66b405b8f91442042e50cbe3c0f8f6c |