preg_replace()
function preg_replace(string $pattern, string $replacement, string $subject): string
Performs a regular expression search and replace.
Parameters:
$pattern(string)$replacement(string)$subject(string)
Returns: string
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/regex/preg_replace.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how preg_replace is implemented in the compiler, see the internals page.