Metadata-Version: 2.4
Name: ogex
Version: 0.1.1
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Topic :: Text Processing
Classifier: Topic :: Software Development :: Libraries
License-File: LICENSE
Summary: Python bindings for Ogex regex engine with unified syntax
Keywords: regex,parsing,text,pattern-matching
Home-Page: https://github.com/NiXTheDev/Ogex
Author: Ogex Contributors
License: MPL-2.0
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/NiXTheDev/Ogex
Project-URL: Repository, https://github.com/NiXTheDev/Ogex

# Ogex Python Bindings

Python bindings for the Ogex regex engine with unified syntax support.

## Installation

```bash
pip install ogex
```

## Usage

```python
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

