Help us shape the future of Go! Take the 2026 Go Developer Survey

regexp

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package regexp implements Regexp\Compile and Regexp\CompilePOSIX, Go's regexp package reached as PHP classes. A script that wants RE2 itself rather than the PCRE surface preg_* presents uses these; docs/bindings-regexp.md walks the binding from here to its fixtures.

The constructors return *regexp.Regexp itself rather than a facade. Every exported method of that type is a regexp operation, so publishing the whole method set is the binding: $rx->find_string($s), $rx->split($s, -1), $rx->replace_all_string($s, $repl). The type is named Regexp, which is the class a script sees for the value and the name instanceof compares against.

It is wired in by importing it; stdlib/imports.go does that.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(rt *runner.Runtime)

Register installs the regexp compilation classes.

Each is its package function behind a closure that names the argument, which is what the generated reference publishes as the PHP signature; registering the bare function would publish Go's own unnamed parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL