Skip to main content

python cffi bindings for the oniguruma regex engine

Project description

Build Status Azure DevOps coverage

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

Uploaded Source

Built Distributions

onigurumacffi-1.0.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl (560.2 kB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

onigurumacffi-1.0.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl (560.2 kB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

onigurumacffi-1.0.0-cp36-abi3-win_amd64.whl (183.4 kB view details)

Uploaded CPython 3.6+ Windows x86-64

onigurumacffi-1.0.0-cp36-abi3-win32.whl (166.6 kB view details)

Uploaded CPython 3.6+ Windows x86

onigurumacffi-1.0.0-cp36-abi3-manylinux1_x86_64.whl (529.8 kB view details)

Uploaded CPython 3.6+

onigurumacffi-1.0.0-cp36-abi3-macosx_10_14_x86_64.whl (221.9 kB view details)

Uploaded CPython 3.6+ macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: onigurumacffi-1.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 969954ee69b1744c3e61fbeb8b5a4b07ab89e529da384feb09a0dfb90977d18f
MD5 9e8bdaa5eccb8da6fea724bad00a2a88
BLAKE2b-256 14562ae4aa2d1b2998cbfb4a9be5ffd9c13743b5ae791998f1bb0f7e891d9fde

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: onigurumacffi-1.0.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 560.2 kB
  • Tags: PyPy, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.0.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9c1469b59f9ef688cd40bb61f4ba733473ebf7b7b96d77c03d6af2da5455ba1b
MD5 92ec2e070af41dc752af46bd568ea55a
BLAKE2b-256 25e1c7409c4e30ea6f36a39c8cba8ad8700318e93694b11fc8ee576003ff08d1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for onigurumacffi-1.0.0-pp37-pypy37_pp73-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 deec30b0e4a030cba2c834bad66be1a5ca71b312bc953554385f257f160a6e4c
MD5 94060521b65e1d415a6aa4aea9e46949
BLAKE2b-256 95e695ce825069b2ae1efea0bca7690732e32ed89e58ba4d8b2bc05860c7da0d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: onigurumacffi-1.0.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 560.2 kB
  • Tags: PyPy, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.0.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2293d1c5ab7f50ffb6c892d320bfb6b650a87baa11b9ce4081540d4551cd72de
MD5 268c06fffefca90de1dcd99d4927958e
BLAKE2b-256 f3fcfad24687efc39db1e5e846cf9a1a2b94512c5afe29c2f696bafed711973f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for onigurumacffi-1.0.0-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 629b0234eab914b4509266120ef5b68cd4535f21062df01fb097152fbc9b76a0
MD5 af50555ad0668e5e756454ce75996f68
BLAKE2b-256 865d2a6574591e159294f065b90cb3e12e09e0474c51da828859029741090c75

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: onigurumacffi-1.0.0-cp36-abi3-win_amd64.whl
  • Upload date:
  • Size: 183.4 kB
  • Tags: CPython 3.6+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.0.0-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ac91d90cdee1eb3e5b73540093ae9f9b6590be3a2319689426eccc11b83f81be
MD5 e39b32eed0cce08291fec7d1d4f34903
BLAKE2b-256 9d7479c5cfb188d913ee03a7780a8e1f9124747e9378c2679d363504e9e0aaf3

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: onigurumacffi-1.0.0-cp36-abi3-win32.whl
  • Upload date:
  • Size: 166.6 kB
  • Tags: CPython 3.6+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.0.0-cp36-abi3-win32.whl
Algorithm Hash digest
SHA256 64a5cb71928690e41926f359607a351867c7c236758d7a029cba2d84e99f2b87
MD5 99d14dc53ab515f84952e74d2d80c60e
BLAKE2b-256 e199c07def07e8521ef57bc0f6654b4bb56e474ee51f2bd26ae1adc9862fb099

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: onigurumacffi-1.0.0-cp36-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 529.8 kB
  • Tags: CPython 3.6+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.0.0-cp36-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 157c97d5a3b3090f0d8551cf8d98797b99ad550bbb6578f3273e62ec00529d6e
MD5 a761b5dc5c1d38955bc6a59628756759
BLAKE2b-256 5ddaa9afec981f78403937eeba061f2ee79d728dba2761f4db74149333efc8f9

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: onigurumacffi-1.0.0-cp36-abi3-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 221.9 kB
  • Tags: CPython 3.6+, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for onigurumacffi-1.0.0-cp36-abi3-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e3beca444897857e289ba4abb39984b1f58d4de9e87659cc955f386edc80ad43
MD5 e1a8492f58ceb222b8ce0424b77a44ea
BLAKE2b-256 25ef14c64a1d7794ec37644921348ac2e15c349a576d257055efd96a6488a5b4

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