Getting started#

Install, then a first match. The drop-in pages cover swapping an API you already use.

Install#

Channel

Command

Homebrew (macOS / Linux)

brew install RECHE23/sci/real-regex

PyPI

pip install real-regex

crates.io

cargo add real-regex

Go

go get github.com/RECHE23/real-regex/bindings/go

vcpkg

vcpkg-sci"dependencies": ["real-regex"]

CMake FetchContent

GIT_REPOSITORY https://github.com/RECHE23/real-regex · GIT_TAG a release

Vendored

copy include/ and compile -std=c++20 -I include

The C++ library is header-only: installing places the headers. C++20 is required; every header asserts it. Consume with CMake (find_package(real CONFIG) + real::real), pkg-config --cflags real, or a plain -I. The SciForge harness is for the test suite, never for the library.

First match#

The same snippets the landing shows — compiled and run by CI, not illustrations.

  // The pattern lives in the type — parsed & compiled at compile time.
  #include <real/real.hpp>
  constexpr real::static_regex<R"((\w+)@(\w+))"> email;
  static_assert(email.search("info@example.com")[2] == "example");
import real as re   # drop-in for the standard library's re

m = re.search(r"(\w+)@(\w+)", "info@example.com")
m.group(2)                # 'example' — linear time, no backtracking cliff
    use real_regex::Regex;   // drop-in for the regex crate

    let re = Regex::new(r"(\w+)@(\w+)")?;
    let caps = re.captures("info@example.com").unwrap();
    &caps[2];              // "example"
import real "github.com/RECHE23/real-regex/bindings/go"
	re := real.MustCompile(`\d+`)
	fmt.Print(re.MatchString("x42"))

Next#

  • Drop-in — swap std::regex, RE2, Python re, the Rust regex crate, or Go regexp.

  • Features — every construct the engine accepts or refuses.

  • How it compares — the capability picture; the measured ledger stays on GitHub.

  • API reference — curated per-object pages.