Ogex Python Bindings
Python bindings for the Ogex regex engine with unified syntax support.
Installation
pip install ogex
Usage
import ogex
# Basic matching
regex = ogex.Regex(r"hello (\w+)")
match = regex.search("hello world")
if match:
print(match.text) # "hello world"
print(match.group(1)) # "world"
# Named groups with unified syntax
regex = ogex.Regex(r"(name:\w+) is \g{name}")
match = regex.search("John is John")
if match:
print(match.text) # "John is John"
print(match.named_group("name")) # "John"
# Relative backreferences
regex = ogex.Regex(r"(a)(b)\g{-1}")
print(regex.is_match("abb")) # True
# Replacements
result = ogex.sub(r"(name:\w+)", r"[\g{name}]", "hello name:world")
print(result) # "hello [world]"
# Find all matches
regex = ogex.Regex(r"\w+")
matches = regex.findall("hello world")
print([m.text for m in matches]) # ["hello", "world"]
API
Regex(pattern)
Compile a regex pattern.
regex.search(string)
Search for the first match.
regex.match_(string)
Match at the start of the string.
regex.is_match(string)
Check if pattern matches.
regex.findall(string)
Find all matches.
regex.sub(repl, string, count=None)
Replace matches.
License
MPL-2.0
Metadata
Release files for ogex 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ogex-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.34+ x86-64 | Details |
Release files / ogex-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl
| Download URL | ogex-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 309.5 kB |
| Tags | CPython 3.14 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
3aaa450438d5e63e86e1f2241b90239ed82428e029eb7f8768a43f439d0a340b
|
|
BLAKE2b-256 checksum How to use checksums |
2545023370026afa692c0d4a6cb81aa39155496375c7dd13f63440536177b1c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.
Transparency log