Python bindings for Ogex regex engine with unified syntax
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ogex-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: ogex-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 309.5 kB
- Tags: CPython 3.14, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aaa450438d5e63e86e1f2241b90239ed82428e029eb7f8768a43f439d0a340b
|
|
| MD5 |
229f755b061cf37b6022c3511c6c6c98
|
|
| BLAKE2b-256 |
2545023370026afa692c0d4a6cb81aa39155496375c7dd13f63440536177b1c3
|
Provenance
The following attestation bundles were made for ogex-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl:
Publisher:
release.yml on NiXTheDev/Ogex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ogex-0.1.1-cp314-cp314-manylinux_2_34_x86_64.whl -
Subject digest:
3aaa450438d5e63e86e1f2241b90239ed82428e029eb7f8768a43f439d0a340b - Sigstore transparency entry: 1174652384
- Sigstore integration time:
-
Permalink:
NiXTheDev/Ogex@73749a65a144184686c73f3bbca631df41451958 -
Branch / Tag:
refs/heads/release - Owner: https://github.com/NiXTheDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@73749a65a144184686c73f3bbca631df41451958 -
Trigger Event:
workflow_dispatch
-
Statement type: