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
  • manylinux 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

_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

_RegSet.search(s: str, start: int = 0) -> 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.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

onigurumacffi-0.0.3-cp36-abi3-manylinux1_x86_64.whl (526.6 kB view details)

Uploaded CPython 3.6+

File details

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

File metadata

  • Download URL: onigurumacffi-0.0.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.9

File hashes

Hashes for onigurumacffi-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0d890cb9a9962bd404ad0142f21668300d71d343d3dd98ff8e17669b0d2740ca
MD5 3bc7d8d883e92d11275749a3eff77bc3
BLAKE2b-256 82822391d4c6e082f957ab0a739e8e52ab6c3181c703f70cb62094b99f636715

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: onigurumacffi-0.0.3-cp36-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 526.6 kB
  • Tags: CPython 3.6+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.9

File hashes

Hashes for onigurumacffi-0.0.3-cp36-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bc1c674322742c1e397ddbbfdd49cf2b6492c8ccb103ad07c3bb3de3b9f37351
MD5 fd0023123235cd753153d5fcbb790aa3
BLAKE2b-256 80804f29968ed6a18c7c66a8854ff3e16bce579816f70fbe070e0c8b4221eb12

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