python cffi bindings for the oniguruma regex engine
Project description
onigurumacffi
python cffi bindings for the oniguruma regex engine
installation
currently this requires libonig-dev
to be installed prior to installation
pip install onigurumacffi
api
the api is currently very limited (basically just enough to support what I needed).
compile(pattern: str) -> _Pattern
make a compiled pattern
_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
_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.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 Distribution
Hashes for onigurumacffi-0.0.2-cp36-abi3-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faffd78ebc6edbd7ae3d3e12a0c57a9702868d4c3bbc40dbd5bfbe069221d411 |
|
MD5 | 56dd6abce129632e08dbcc537b83b99c |
|
BLAKE2b-256 | e1552b1a966a3fdacc17ed1abdb3f4591bb9493b021f27790a6d568262a9ab3f |