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

Uploaded Source

Built Distributions

onigurumacffi-0.0.17-pp36-pypy36_pp73-manylinux2010_x86_64.whl (561.2 kB view details)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

onigurumacffi-0.0.17-cp38-cp38-win_amd64.whl (183.6 kB view details)

Uploaded CPython 3.8 Windows x86-64

onigurumacffi-0.0.17-cp38-cp38-win32.whl (167.4 kB view details)

Uploaded CPython 3.8 Windows x86

onigurumacffi-0.0.17-cp37-cp37m-win_amd64.whl (183.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

onigurumacffi-0.0.17-cp37-cp37m-win32.whl (167.4 kB view details)

Uploaded CPython 3.7m Windows x86

onigurumacffi-0.0.17-cp36-cp36m-win_amd64.whl (183.6 kB view details)

Uploaded CPython 3.6m Windows x86-64

onigurumacffi-0.0.17-cp36-cp36m-win32.whl (167.4 kB view details)

Uploaded CPython 3.6m Windows x86

onigurumacffi-0.0.17-cp36-abi3-manylinux1_x86_64.whl (532.6 kB view details)

Uploaded CPython 3.6+

onigurumacffi-0.0.17-cp36-abi3-macosx_10_14_x86_64.whl (223.2 kB view details)

Uploaded CPython 3.6+ macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: onigurumacffi-0.0.17.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17.tar.gz
Algorithm Hash digest
SHA256 38bc9b9fbca2250b3879099073b69adf8ad1260e6d37889d8f0629d4fe27e4e6
MD5 388eb790bc2cd38864db9bd3574b0af8
BLAKE2b-256 e787cccf68c482d8d02e4a520dec2dc3a287772ddc6a5862cf55c36453838e67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onigurumacffi-0.0.17-pp36-pypy36_pp73-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 561.2 kB
  • Tags: PyPy, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 936fcaeb78fa84bfb220096902c025ed10c6bc6686b1e575119634ff74403810
MD5 49565663cc583f0a5dcc63943e85edf4
BLAKE2b-256 615b039e5030917f371b21e4fc23a7f782e901674510ec7e777fcf24e706f55f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for onigurumacffi-0.0.17-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 035f4e922f2074d5152eebe8c506120d49e61d6b92c78035dbebb74f4505747d
MD5 bea6138342206af900fda07e97467fd8
BLAKE2b-256 e68e63c3e8acbe54377303f28eb66c1edbcd63bf559e2ac2aedfae320d9ff30f

See more details on using hashes here.

File details

Details for the file onigurumacffi-0.0.17-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: onigurumacffi-0.0.17-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 183.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 1f5fb4216f632e727fcab1ae5ff9708122422729853baddc1db89d6a8b7ecec1
MD5 03a4e8a75e39357f2e522dfc6bd20b26
BLAKE2b-256 b8dab3834ece447c84e9d59c85e12fd57e7f6e8e79a474e6bf12491f25bbd2e3

See more details on using hashes here.

File details

Details for the file onigurumacffi-0.0.17-cp38-cp38-win32.whl.

File metadata

  • Download URL: onigurumacffi-0.0.17-cp38-cp38-win32.whl
  • Upload date:
  • Size: 167.4 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 75cf0ea5e4441e52abe96e3926079bcc3eece1886b783e7b5b38796a69c5dd60
MD5 de01e07c56f09d45dbc20599e177854c
BLAKE2b-256 1d4673c4b25d87681ac7c4d822c20f01523525953d226bd78e10b8504d9e6af8

See more details on using hashes here.

File details

Details for the file onigurumacffi-0.0.17-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: onigurumacffi-0.0.17-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 183.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 7e975dcbfa425205bc0d9bef8facdcc0659ff70be344d2ce3fd8421e97c6c96e
MD5 8966f5807656bab0dad2ccf04e528172
BLAKE2b-256 1a83be92467a4441189091f76daf51188a55bd318dbe93db655d2bb5c262dd67

See more details on using hashes here.

File details

Details for the file onigurumacffi-0.0.17-cp37-cp37m-win32.whl.

File metadata

  • Download URL: onigurumacffi-0.0.17-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 167.4 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 61deac0ef14a8f3480a0a986662642f3970eeb07acc94b12a3b85bdabaa43484
MD5 d5a1fa97acdfebad0f2199583cec5586
BLAKE2b-256 4efb118cd12c7fb74cb56b8be3df4f101cc29f59fcc2734399a47f5ca0347f1b

See more details on using hashes here.

File details

Details for the file onigurumacffi-0.0.17-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: onigurumacffi-0.0.17-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 183.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 0b18929701cb0246c7059d55c99e3b283dd6d688d74ae9c60fa612ed50014ab4
MD5 91d36cb8c1f607a30889fe2c1bb4a9b9
BLAKE2b-256 9a84a84175f53e35f035b4e8995de78c64ed9586698ef62d268fb2222b914aab

See more details on using hashes here.

File details

Details for the file onigurumacffi-0.0.17-cp36-cp36m-win32.whl.

File metadata

  • Download URL: onigurumacffi-0.0.17-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 167.4 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 99598eba01dfcf7a7cd12798ff917b61d71e0c081b686221ad665ee88874ab00
MD5 3c74a3baf8ab471240b51d5d29f799ad
BLAKE2b-256 7db2cc6ce5af147b31c6a1fa18f725add2892979c274676cc907fb27619419d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onigurumacffi-0.0.17-cp36-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 532.6 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/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-cp36-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2dd4e05add9e2e3d7f14460a14cd8d6c68d3ae150c9a1b7272e0649c541fd272
MD5 d996df90069e584a5c4c16c8c6a658d1
BLAKE2b-256 f5b04285ba8672cda4f569b6adf8f57d7ec84ae74cd913999d0c456aa7e3fb59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onigurumacffi-0.0.17-cp36-abi3-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 223.2 kB
  • Tags: CPython 3.6+, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for onigurumacffi-0.0.17-cp36-abi3-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 54a87a281d3a624692b8d2e6e8a0196fc21cfd395a3d73bfcc3f1c2e4b5ecd95
MD5 b558f2f6407d78d30d4a3f1e2174ea39
BLAKE2b-256 b045ce1a8648e3d8f969b63aed5a4f645969013a381457b2c5dfe43657aaa5b9

See more details on using hashes here.

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