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.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distributions

onigurumacffi-1.1.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl (566.8 kB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

onigurumacffi-1.1.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl (566.8 kB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

onigurumacffi-1.1.0-cp38-abi3-macosx_12_0_arm64.whl (197.3 kB view details)

Uploaded CPython 3.8+ macOS 12.0+ ARM64

onigurumacffi-1.1.0-cp36-abi3-win_amd64.whl (184.4 kB view details)

Uploaded CPython 3.6+ Windows x86-64

onigurumacffi-1.1.0-cp36-abi3-win32.whl (167.8 kB view details)

Uploaded CPython 3.6+ Windows x86

onigurumacffi-1.1.0-cp36-abi3-manylinux1_x86_64.whl (536.2 kB view details)

Uploaded CPython 3.6+

onigurumacffi-1.1.0-cp36-abi3-macosx_10_14_x86_64.whl (224.6 kB view details)

Uploaded CPython 3.6+ macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: onigurumacffi-1.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5b5196989639d4b32d44a67d4b8d0c335886fb3ed6c496bbe72616684239e5f3
MD5 e49e0bc54cc08d756e62c1e94c03fff0
BLAKE2b-256 6b97641f41ad973ae3243fc0b5db11a752f17794f49ccc8acf2eb3a3628ba0c9

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl.

File metadata

  • Download URL: onigurumacffi-1.1.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 566.8 kB
  • Tags: PyPy, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.1.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 83a031a11cc16aea7c13e513e1b7eff35157cfda4fcc6e561a4b50f4e2eabe75
MD5 e61da0aa6176dd83623264b0eeadb48b
BLAKE2b-256 2952d3e15bf0229207d598f16a32859c4064990040f63a5e30633ecdf44d6c23

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-pp37-pypy37_pp73-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for onigurumacffi-1.1.0-pp37-pypy37_pp73-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1dcbefbe113e26467e8464434f4fae81ad9a8b813c8766161970114c5aade920
MD5 f7f55092a4fb7975499f1c6fb2ecf0f8
BLAKE2b-256 408793769b0140d9284216a67a468d1b798176309d833cc8995a540ea69c736d

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl.

File metadata

  • Download URL: onigurumacffi-1.1.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 566.8 kB
  • Tags: PyPy, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.1.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b2b1b9813d791a292b71f7fd28d76d9e3e5d2f17b7872e6b1563419e041e9a1f
MD5 4b3c51be0013a28befa3551725fa4429
BLAKE2b-256 f117bd469ab8f2e2cb8287ae9185db46e3b9cb61fdec42078241fd9b715133c8

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-pp36-pypy36_pp73-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for onigurumacffi-1.1.0-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 357bad8c80ffcf923de916002703bdff15a7eaefdd0da009f5b7b64ae841bc71
MD5 058ff78566fff1f62356f141d357139c
BLAKE2b-256 1743f2919ff066a308396ab797f1f8cbd5a61f389466843b7c26fec1fa3fd41d

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-cp38-abi3-macosx_12_0_arm64.whl.

File metadata

  • Download URL: onigurumacffi-1.1.0-cp38-abi3-macosx_12_0_arm64.whl
  • Upload date:
  • Size: 197.3 kB
  • Tags: CPython 3.8+, macOS 12.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9

File hashes

Hashes for onigurumacffi-1.1.0-cp38-abi3-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 668bc947afcc4da36c4c3b0cb5c33e0ec023aeb420c1a61671d4d4e926f2f683
MD5 ca2bc1f19bfcb6ede484c7990a2442fa
BLAKE2b-256 b1f1a602de59169bc1078f2db677bf427e7c1627733125a44977679c30d8d929

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-cp36-abi3-win_amd64.whl.

File metadata

  • Download URL: onigurumacffi-1.1.0-cp36-abi3-win_amd64.whl
  • Upload date:
  • Size: 184.4 kB
  • Tags: CPython 3.6+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.1.0-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 688c4e0567cab0d599f210cc6cf60c876cb3e6adb1ad0b3d0b782d929cbee560
MD5 3913c6ef3dd0e46c7e21bea02902454a
BLAKE2b-256 2f246079260b15703ecc783023093c97fa090a675cb24f7346b9cece772a5e88

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-cp36-abi3-win32.whl.

File metadata

  • Download URL: onigurumacffi-1.1.0-cp36-abi3-win32.whl
  • Upload date:
  • Size: 167.8 kB
  • Tags: CPython 3.6+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.1.0-cp36-abi3-win32.whl
Algorithm Hash digest
SHA256 d23f5cfaff3dd785d2420582d5a2e4c192a4cff22293713e133a466ceb615cc4
MD5 5eddc3e15f1098f39b1c4ae1acbcc67f
BLAKE2b-256 b3973babbfc95097738349c7e0c7594e811cfa639224c2205ba050f73ac7dc52

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-cp36-abi3-manylinux1_x86_64.whl.

File metadata

  • Download URL: onigurumacffi-1.1.0-cp36-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 536.2 kB
  • Tags: CPython 3.6+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.1.0-cp36-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0374a4321fd8a0edd466b9c83d5e0ec5bd3a514f49c44c1f494bf6d8715c9aa5
MD5 4172d1feb1c63cdcdb711d534ede7f07
BLAKE2b-256 40ae3e64fd0ea1a5fc1365d419c0a9a317073b72c2571fc4445c793b41d7f577

See more details on using hashes here.

Provenance

File details

Details for the file onigurumacffi-1.1.0-cp36-abi3-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: onigurumacffi-1.1.0-cp36-abi3-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 224.6 kB
  • Tags: CPython 3.6+, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.1.0-cp36-abi3-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 84b25f8f73421ecff249e3cba853a8b999bc993a120e87bdd0d958171039bd7d
MD5 65e926aa928d11ff5f610310854396eb
BLAKE2b-256 746c7afb7666916923f52d2450f13408f0df296c7f18885a413d9cfd2abbc634

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