Skip to main content

python cffi bindings for the oniguruma regex engine

Project description

Build Status Azure DevOps coverage pre-commit.ci status

onigurumacffi

python cffi bindings for the oniguruma regex engine

installation

pip install onigurumacffi
  • 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

OnigSearchOption

an enum listing the search-time options for oniguruma

the current set of options are:

class OnigSearchOption(enum.IntEnum):
    NONE = ...
    NOTBOL = ...
    NOTEOL = ...
    POSIX_REGION = ...
    CHECK_VALIDITY_OF_STRING = ...
    NOT_BEGIN_STRING = ...
    NOT_BEGIN_POSITION = ...

_Pattern.match(s: str, start: int = 0, flags: OnigSearchOption = OnigSearchOption.NONE) -> 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, flags: OnigSearchOption = OnigSearchOption.NONE) -> 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, flags: OnigSearchOption = OnigSearchOption.NONE) -> 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onigurumacffi-1.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distributions

onigurumacffi-1.2.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (571.6 kB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

onigurumacffi-1.2.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (571.6 kB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

onigurumacffi-1.2.0-cp38-abi3-macosx_11_0_arm64.whl (221.1 kB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

onigurumacffi-1.2.0-cp37-abi3-win_amd64.whl (190.0 kB view details)

Uploaded CPython 3.7+ Windows x86-64

onigurumacffi-1.2.0-cp37-abi3-win32.whl (175.0 kB view details)

Uploaded CPython 3.7+ Windows x86

onigurumacffi-1.2.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (595.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ x86-64

onigurumacffi-1.2.0-cp37-abi3-macosx_10_14_x86_64.whl (236.0 kB view details)

Uploaded CPython 3.7+ macOS 10.14+ x86-64

File details

Details for the file onigurumacffi-1.2.0.tar.gz.

File metadata

  • Download URL: onigurumacffi-1.2.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for onigurumacffi-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e73e3c12aff4b5a4974e830cb1961ec4b58ca2e699f34bd4adc8d8f9a4fbcfe5
MD5 c04eaff53a5160608d683d71df9185cb
BLAKE2b-256 833cc96d657459daea4f65cf8aa7b8c2a2f37b5ad9fbe624f033f6928decbebf

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.2.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

  • Download URL: onigurumacffi-1.2.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
  • Upload date:
  • Size: 571.6 kB
  • Tags: PyPy, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for onigurumacffi-1.2.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d6d3fae6fb3b70445b808b6d0209017da5390f984dcfc8977be619753290d551
MD5 36876e6beb9f1ff8aed7207bb9cc13b9
BLAKE2b-256 49102167f055287011b96313714bc7ef929b76042b10de65322491f924f8f7aa

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.2.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

  • Download URL: onigurumacffi-1.2.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
  • Upload date:
  • Size: 571.6 kB
  • Tags: PyPy, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for onigurumacffi-1.2.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 38a5f9879413242e7c94644d73db53d0fc7030980f19a818ff34ed1c47016fed
MD5 0590d1d0b2efa2cac146f20ab3241e42
BLAKE2b-256 6398ae11f8cb0073c6f91c14f731343937f3b65af26de24df91cc2122749f457

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.2.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for onigurumacffi-1.2.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8af421ff7370e6f5dd8202c1e5ae3140231f2744eafa0e448ef84d64fc6b8555
MD5 3d9dd42a48bee71d8e655959488432cd
BLAKE2b-256 1dea47917d482214cd0a462f594d3682e9675679e4d06bbcb874d6e55179fc8d

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.2.0-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: onigurumacffi-1.2.0-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 190.0 kB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for onigurumacffi-1.2.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c836eefcec4e7e57946efd6bf54d883d7ec9396a80fdf17ba03f43289adfe77d
MD5 766f4dcab593137e735898333b064dc0
BLAKE2b-256 b7d6fc997529880d6bacd3810f7d740ba11a7c108569a868ed5ba83837f7bde6

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.2.0-cp37-abi3-win32.whl.

File metadata

  • Download URL: onigurumacffi-1.2.0-cp37-abi3-win32.whl
  • Upload date:
  • Size: 175.0 kB
  • Tags: CPython 3.7+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for onigurumacffi-1.2.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 fdefc71122937d1f544160349f8c96791a90470731408ac445caae816182b1c1
MD5 9c41587376d7e55b47cec13842122f2d
BLAKE2b-256 4184618e7ceda70618c6c9716ad64308dba5377db8c27b7acc231591e0e5d75e

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.2.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

  • Download URL: onigurumacffi-1.2.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
  • Upload date:
  • Size: 595.0 kB
  • Tags: CPython 3.7+, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for onigurumacffi-1.2.0-cp37-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 468bdb34cb44e031a290da82bc652edf2a99f5749b976fecec6a62832118fd14
MD5 bd50ae4079417543e636949ff2705138
BLAKE2b-256 32c6beddb3240afce609d9b1e9454bf63a9cfa33686ef8d1e02158dc884a7e12

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.2.0-cp37-abi3-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: onigurumacffi-1.2.0-cp37-abi3-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 236.0 kB
  • Tags: CPython 3.7+, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for onigurumacffi-1.2.0-cp37-abi3-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 edd4e2276352283f960d57e8c657fc96f598af4cb3e7e039ce57f9a06862e0a9
MD5 c31ba45255be6a3cf6ce3f83503bdf3e
BLAKE2b-256 41515051847a9bc8a8f33cffa85f196e8191d3e714087c375e63f096dedf5956

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page