reg.um



type Reg* = ^struct{}

type Match* = struct {
	start, end: int32
}

fn reg__compile(ex: str): Reg
fn compile*(ex: str): Reg {
	return reg__compile(ex)
}

fn reg__error(r: Reg, buf: ^[]char)
fn getError*(r: Reg): str {
	buf := make([]char, 4096)	
	reg__error(r, &buf)

	return str(buf)	
}

fn reg__exec(r: Reg, buf: str, ret: ^Match)
fn exec*(r: Reg, buf: str): Match {
	m := Match{}
	reg__exec(r, buf, &m)

	return m
}