Skip to main content

build status 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

Release files for onigurumacffi 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onigurumacffi 1.5.0
File Size Uploaded
onigurumacffi-1.5.0.tar.gz 5.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for onigurumacffi 1.5.0
File
onigurumacffi-1.5.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl PyPy 3.11 PyPy 3.11 7.3 Linux glibc 2.17+ x86-64 Details
onigurumacffi-1.5.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
onigurumacffi-1.5.0-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details
onigurumacffi-1.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
onigurumacffi-1.5.0-cp310-abi3-macosx_15_0_x86_64.whl CPython 3.10 abi3 macOS 15.0+ x86-64 Details
onigurumacffi-1.5.0-cp310-abi3-macosx_15_0_arm64.whl CPython 3.10 abi3 macOS 15.0+ ARM64 Details

Total release size: 2.0 MB

Release files / onigurumacffi-1.5.0.tar.gz

Download URL onigurumacffi-1.5.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d4fa9bee44a6d38a98b2237c67d9acdf27ed0c32d6c218125fe46681a5edea4d
BLAKE2b-256 checksum
How to use checksums
b5e9fab7102ca135470374f81e74e9944c9f58f2bae905df2c045ac0f30838fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / onigurumacffi-1.5.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL onigurumacffi-1.5.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 585.1 kB
Tags Linux glibc 2.17+ x86-64 PyPy 3.11 PyPy 3.11 7.3
SHA-256 checksum
How to use checksums
a1f39d9edccc63010ee7667b6e8c029e856031adfac3f0581efe4cb71a1083ff
BLAKE2b-256 checksum
How to use checksums
301be801d3a6ebf5adec84ec8f6df19944177e42635174a28164f20157f4ad6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / onigurumacffi-1.5.0-cp310-abi3-win_amd64.whl

Download URL onigurumacffi-1.5.0-cp310-abi3-win_amd64.whl
Size 193.4 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
862795245ac165913f146e81d18e5419c91f98f50a5eccba02e1ba6d781e8e26
BLAKE2b-256 checksum
How to use checksums
a3676461766dc7e7baea1b02df2c081ac7efcde3edf9cb74a80f570a7dc0566b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / onigurumacffi-1.5.0-cp310-abi3-win32.whl

Download URL onigurumacffi-1.5.0-cp310-abi3-win32.whl
Size 178.8 kB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
995a3a0d932df3995f6e9b081c4c5881ed6bc19c53d9c24d64a51eb21f46989c
BLAKE2b-256 checksum
How to use checksums
e27cfda92bcc28c6ef05d6ce4cfd0f85e7a70e6fa9ea3a23fb7fe1b4cf6ef092
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / onigurumacffi-1.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL onigurumacffi-1.5.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 605.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d2e195b0255f88616af19021ebd6344a00d5a0df01a78c8c43729cf0b9c9fb9c
BLAKE2b-256 checksum
How to use checksums
2116df7857783279384c910ac6c5272699a226fcec9dc8969b4fe230069d2f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / onigurumacffi-1.5.0-cp310-abi3-macosx_15_0_x86_64.whl

Download URL onigurumacffi-1.5.0-cp310-abi3-macosx_15_0_x86_64.whl
Size 236.0 kB
Tags CPython 3.10 abi3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
3aabcd932605f0a385c612ff22daa97acfa57e78add53bb4a173f281a3b9cf1f
BLAKE2b-256 checksum
How to use checksums
e0c1e211c1f803c4b1315a8e2b017c7257ce5a7b11543ad63f3b7d19696c845f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / onigurumacffi-1.5.0-cp310-abi3-macosx_15_0_arm64.whl

Download URL onigurumacffi-1.5.0-cp310-abi3-macosx_15_0_arm64.whl
Size 224.8 kB
Tags CPython 3.10 abi3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
6dda67bcbfe5ec8f819506befaa8542f7bc4dd89304dfae31810bf4f15dc2205
BLAKE2b-256 checksum
How to use checksums
8bf92717b5a52032b74e0f53022941baf24dc50ecc99fb31da5621b88882ce64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.5.0 This release

7 release files

1.4.1

7 release files

1.4.0

3 release files

1.3.0

9 release files

1.2.0

8 release files

1.1.0

10 release files

1.0.0

9 release files

0.0.21

7 release files

0.0.15

9 release files

0.0.13

6 release files

0.0.12

6 release files

0.0.11

3 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page