Ogex, the regex we deserved
  • Rust 94.6%
  • Python 3.1%
  • HTML 1%
  • TypeScript 0.6%
  • JavaScript 0.4%
  • Other 0.3%
Find a file
NiXTheDev 153a9e2b9f
Some checks failed
Push Checks / Format Check (push) Failing after 6s
Push Checks / Clippy (push) Failing after 25s
Push Checks / Type Check (push) Failing after 22s
Push Checks / Tests (push) Has been skipped
Push Checks / Test Ogex CLI (push) Has been skipped
Notice
2026-06-02 20:25:32 +03:00
.githooks 0.1.1 version release (#1) 2026-03-24 20:40:06 +03:00
.github ci: publish npm under @ogex org (#73) 2026-03-26 00:11:18 +03:00
ogex 0.1.1 version release (#1) 2026-03-24 20:40:06 +03:00
ogex-cli Release v0.1.1 (#34) 2026-03-24 21:27:37 +03:00
ogex-python 0.1.1 version release (#1) 2026-03-24 20:40:06 +03:00
.gitignore 0.1.1 version release (#1) 2026-03-24 20:40:06 +03:00
Cargo.toml 0.1.1 version release (#1) 2026-03-24 20:40:06 +03:00
LICENSE Initial commit 2026-02-19 22:20:02 +03:00
MIGRATION.md docs: add migration guide from traditional regex to Ogex 2026-02-21 23:15:06 +03:00
README.md Notice 2026-06-02 20:25:32 +03:00
test_ogex.html refactor(rename): more complete renaming of ogex-core and ogex_core to 2026-02-21 23:52:34 +03:00
test_ogex.py test: add test files for WASM and Python bindings 2026-02-21 21:23:09 +03:00
test_ogex.ts refactor(rename): more complete renaming of ogex-core and ogex_core to 2026-02-21 23:52:34 +03:00
test_ogex_node.mjs refactor(rename): more complete renaming of ogex-core and ogex_core to 2026-02-21 23:52:34 +03:00

Ogex

A custom regex engine with unified syntax for named groups and backreferences.

Overview

Ogex introduces a cleaner, more intuitive syntax for named capturing groups and backreferences:

  • Named groups: (name:pattern) instead of (?<name>pattern)
  • Backreferences: \g{name} or \g{1} instead of \k<name> or \1
  • Works identically in patterns and replacement strings

The engine is written in Rust for performance and provides bindings for multiple languages.

Important

This project is going to soon be moved to a self-hosted Forgejo instance Currently it will act as a push-mirror, and in the future, github will be the push-mirror The repository is already available at: https://hangar.nixthedev.ru/NiXTheDev/Ogex

Crates

Crate Description
ogex Core regex library (Rust)
ogex-cli CLI tool
ogex-python Python bindings

Quick Start

Rust

See ogex/README.md

JavaScript/WASM

import { Regex } from '@ogex/ogex';

const regex = new Regex('(name:hello)');
const match = regex.find('hello world');
console.log(match.text);  // "hello"

Python

import ogex

regex = ogex.Regex(r"(name:\w+) is \g{name}")
match = regex.search("John is John")
print(match.named_group("name"))  # "John"

CLI

# Test a pattern
ogex test "(name:hello)" "hello world"

# Convert syntax
ogex convert "(name:abc)"
# Output: (?<name>abc)

License

  • ogex: MPL-2.0
  • ogex-cli: MIT