Namespace

Runtime\PS\Regexp

Package regexp implements Regexp\Compile and Regexp\CompilePOSIX, Go's regexp package reached as PHP classes.

Description

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 and no facade. Every exported method of that type is a regexp operation and publishing the whole method set is the binding: $rx->find_string($s), $rx->split($s, -1), $rx->replace_all_string($s, $repl). The runtime publishes the type as Regexp, the class a script sees for the value and the name instanceof compares against.

stdlib/imports.go wires it in by importing it.

Package
stdlib/ps/regexpgodoc